Skip to content

Instantly share code, notes, and snippets.

@geographika
Created April 24, 2019 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geographika/504859a6f08c8152d17f33d4e6a7c402 to your computer and use it in GitHub Desktop.
Save geographika/504859a6f08c8152d17f33d4e6a7c402 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
%includefile "/usr/share/swig/4.0.0/swig.swg" %beginfile
/* -----------------------------------------------------------------------------
* swig.swg
*
* Common macro definitions for various SWIG directives. This file is always
* included at the top of each input file.
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* User Directives
* ----------------------------------------------------------------------------- */
/* Deprecated SWIG-1.1 directives */
/* Code insertion directives such as %wrapper %{ ... %} */
/* Class extension */
/* %ignore directive */
/* Access control directives */
/* Generation of default constructors/destructors (old form, don't use) */
/* Disable the generation of implicit default constructor */
/* Disable the generation of implicit default destructor (dangerous) */
/* Enable the generation of copy constructor */
/* Force the old nodefault behavior, ie disable both constructor and destructor */
/* the %exception directive */
/* the %allowexception directive allows the %exception feature to
be applied to set/get variable methods */
/* the %exceptionvar directive, as %exception but it is only applied
to set/get variable methods. You don't need to use the
%allowexception directive when using %exceptionvar.
*/
/* the %catches directive */
/* the %exceptionclass directive */
/* the %newobject directive */
/* the %delobject directive */
/* the %refobject/%unrefobject directives */
/* Directives for callback functions (experimental) */
/* the %nestedworkaround directive (deprecated) */
/* the %flatnested directive */
/* the %fastdispatch directive */
/* directors directives */
/* naturalvar directives */
/* nspace directives */
/* valuewrapper directives */
/* Contract support - Experimental and undocumented */
/* Macro for setting a dynamic cast function */
/* aggregation support */
/*
This macro performs constant aggregation. Basically the idea of
constant aggregation is that you can group a collection of constants
together. For example, suppose you have some code like this:
#define UP 1
#define DOWN 2
#define LEFT 3
#define RIGHT 4
Now, suppose you had a function like this:
int move(int direction)
In this case, you might want to restrict the direction argument to
one of the supplied constant names. To do this, you could write some
typemap code by hand. Alternatively, you can use the
%aggregate_check macro defined here to create a simple check
function for you. Here is an example:
%aggregate_check(int, check_direction, UP, DOWN, LEFT, RIGHT);
Now, using a typemap
%typemap(check) int direction {
if (!check_direction($1)) SWIG_exception(SWIG_ValueError,"Bad direction.");
}
or a contract (better)
%contract move(int x) {
require:
check_direction(x);
}
*/
/* -----------------------------------------------------------------------------
* %rename predicates
* ----------------------------------------------------------------------------- */
/*
Predicates to be used with %rename, for example:
- to rename all the functions:
%rename("%(utitle)s", %$isfunction) "";
- to rename only the member methods:
%rename("m_%(utitle)s", %$isfunction, %$ismember) "";
- to rename only the global functions:
%rename("m_%(utitle)s", %$isfunction, %$not %$ismember) "";
or
%rename("g_%(utitle)s", %$isfunction, %$isglobal) "";
- to ignore the enumitems in a given class:
%rename("$ignore", %$isenumitem, %$classname="MyClass") "";
we use the prefix '%$' to avoid clashes with other swig
macros/directives.
*/
/* %constant definition */
/* -----------------------------------------------------------------------------
* Common includes for warning labels, macros, fragments etc
* ----------------------------------------------------------------------------- */
%includefile "/usr/share/swig/4.0.0/swigwarnings.swg" %beginfile
/*
Include the internal swig macro codes. These macros correspond to
the one found in Source/Include/swigwarn.h plus the 'SWIG' prefix.
For example, in the include file 'swigwarn.h' you will find
#define WARN_TYPEMAP_CHARLEAK ...
and in the 'swigwarn.swg' interface, you will see
%define SWIGWARN_TYPEMAP_CHARLEAK ...
This code can be used in warning filters as follows:
%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK);
Warnings messages used in typemaps. Message names will be the same
as those in Lib/swigwarn.swg but with the suffix _MSG.
For example, for the code SWIGWARN_TYPEMAP_CHARLEAK, once you use
%typemapmsg(CHARLEAK,<msg>);
you use the message in your typemap as
%typemap(varin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) char *
while you suppress the warning using
%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK);
as described above.
*/
/* -----------------------------------------------------------------------------
* SWIG warning codes
* ----------------------------------------------------------------------------- */
%includefile "/usr/share/swig/4.0.0/swigwarn.swg" %beginfile
/* SWIG warning codes - generated from swigwarn.h - do not edit */
/* -- Deprecated features -- */
/* -- Preprocessor -- */
/* -- C/C++ Parser -- */
/* redundant now */
/* redundant now */
/* new */
/* delete */
/* + */
/* - */
/* * */
/* / */
/* % */
/* ^ */
/* & */
/* | */
/* ~ */
/* ! */
/* = */
/* < */
/* > */
/* += */
/* -= */
/* *= */
/* /= */
/* %= */
/* ^= */
/* &= */
/* |= */
/* << */
/* >> */
/* <<= */
/* >>= */
/* == */
/* != */
/* <= */
/* >= */
/* && */
/* || */
/* ++ */
/* -- */
/* , */
/* ->* */
/* -> */
/* () */
/* [] */
/* + */
/* - */
/* * */
/* & */
/* new [] */
/* delete [] */
/* operator *() */
/* 394-399 are reserved */
/* -- Type system and typemaps -- */
/* mostly used in directorout typemaps */
/* -- Fragments -- */
/* -- General code generation -- */
/* -- Doxygen comments -- */
/* -- Reserved (600-799) -- */
/* -- Language module specific warnings (700 - 899) -- */
/* please leave 700-719 free for D */
/* please leave 720-739 free for Scilab */
/* please leave 740-759 free for Python */
/* please leave 800-809 free for Ruby */
/* please leave 810-829 free for Java */
/* please leave 830-849 free for C# */
/* please leave 850-869 free for Modula 3 */
/* please leave 870-889 free for PHP */
/* please leave 890-899 free for Go */
/* -- User defined warnings (900 - 999) -- */
%endoffile
/* -----------------------------------------------------------------------------
* Auxiliary macros
* ----------------------------------------------------------------------------- */
/* Macro to define warning messages */
/* -----------------------------------------------------------------------------
* Typemap related warning messages
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Operator related warning messages
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Macros for keyword and built-in names
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Warning filter feature
* ----------------------------------------------------------------------------- */
%endoffile
%includefile "/usr/share/swig/4.0.0/swigfragments.swg" %beginfile
/* -----------------------------------------------------------------------------
* swigfragments.swg
*
* Common fragments
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Fragments for C header files
* ----------------------------------------------------------------------------- */
%fragment("<float.h>", "header") %{
#include <float.h>
%}
/* Default compiler options for gcc allow long_long but not LLONG_MAX.
* Define SWIG_NO_LLONG_MAX if this added limits support is not wanted. */
%fragment("<limits.h>", "header") %{
#include <limits.h>
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
# define LLONG_MAX __LONG_LONG_MAX__
# define LLONG_MIN (-LLONG_MAX - 1LL)
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
# endif
#endif
%}
%fragment("<math.h>", "header") %{
#include <math.h>
%}
%fragment("<stddef.h>", "header") %{
#include <stddef.h>
%}
%fragment("<stdio.h>", "header") %{
#include <stdio.h>
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
# ifndef snprintf
# define snprintf _snprintf
# endif
#endif
%}
%fragment("<stdlib.h>", "header") %{
#include <stdlib.h>
#ifdef _MSC_VER
# ifndef strtoull
# define strtoull _strtoui64
# endif
# ifndef strtoll
# define strtoll _strtoi64
# endif
#endif
%}
%fragment("<wchar.h>", "header") %{
#include <wchar.h>
#include <limits.h>
#ifndef WCHAR_MIN
# define WCHAR_MIN 0
#endif
#ifndef WCHAR_MAX
# define WCHAR_MAX 65535
#endif
%}
/* -----------------------------------------------------------------------------
* Fragments for C++ header files
* ----------------------------------------------------------------------------- */
%fragment("<algorithm>", "header") %{
#include <algorithm>
%}
%fragment("<stdexcept>", "header") %{
#include <stdexcept>
%}
%fragment("<string>", "header") %{
#include <string>
%}
%fragment("<memory>", "header") %{
#include <memory>
%}
%endoffile
/* -----------------------------------------------------------------------------
* Overloading support
* ----------------------------------------------------------------------------- */
/*
* Function/method overloading support. This is done through typemaps,
* but also involves a precedence level.
*/
/* Macro for overload resolution */
/* Macros for precedence levels */
/* -----------------------------------------------------------------------------
* Default handling of certain overloaded operators
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Default char * and C array typemaps
* ----------------------------------------------------------------------------- */
/* Set up the typemap for handling new return strings */
%typemap(newfree) char * "free($1);";
/* Default typemap for handling char * members */
%typemap(memberin) char * {
free($1);
if ($input) {
$1 = ($1_type) malloc(strlen((const char *)$input)+1);
strcpy((char *)$1, (const char *)$input);
} else {
$1 = 0;
}
}
%typemap(memberin,warning= "451:Setting a const char * variable may leak memory." ) const char * {
if ($input) {
$1 = ($1_type) malloc(strlen((const char *)$input)+1);
strcpy((char *)$1, (const char *)$input);
} else {
$1 = 0;
}
}
%typemap(globalin) char * {
free($1);
if ($input) {
$1 = ($1_type) malloc(strlen((const char *)$input)+1);
strcpy((char *)$1, (const char *)$input);
} else {
$1 = 0;
}
}
%typemap(globalin,warning= "451:Setting a const char * variable may leak memory." ) const char * {
if ($input) {
$1 = ($1_type) malloc(strlen((const char *)$input)+1);
strcpy((char *)$1, (const char *)$input);
} else {
$1 = 0;
}
}
/* Character array handling */
%typemap(memberin) char [ANY] {
if($input) {
strncpy((char*)$1, (const char *)$input, $1_dim0-1);
$1[$1_dim0-1] = 0;
} else {
$1[0] = 0;
}
}
%typemap(globalin) char [ANY] {
if($input) {
strncpy((char*)$1, (const char *)$input, $1_dim0-1);
$1[$1_dim0-1] = 0;
} else {
$1[0] = 0;
}
}
%typemap(memberin) char [] {
if ($input) strcpy((char *)$1, (const char *)$input);
else $1[0] = 0;
}
%typemap(globalin) char [] {
if ($input) strcpy((char *)$1, (const char *)$input);
else $1[0] = 0;
}
/* memberin/globalin typemap for arrays. */
%typemap(memberin) SWIGTYPE [ANY] {
size_t ii;
$1_basetype *b = ($1_basetype *) $1;
for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);
}
%typemap(globalin) SWIGTYPE [ANY] {
size_t ii;
$1_basetype *b = ($1_basetype *) $1;
for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);
}
/* memberin/globalin typemap for double arrays. */
%typemap(memberin) SWIGTYPE [ANY][ANY] {
$basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input);
$basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1);
size_t ii = 0;
for (; ii < $1_dim0; ++ii) {
$basetype *ip = inp[ii];
$basetype *dp = dest[ii];
size_t jj = 0;
for (; jj < $1_dim1; ++jj) dp[jj] = ip[jj];
}
}
%typemap(globalin) SWIGTYPE [ANY][ANY] {
$basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input);
$basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1);
size_t ii = 0;
for (; ii < $1_dim0; ++ii) {
$basetype *ip = inp[ii];
$basetype *dp = dest[ii];
size_t jj = 0;
for (; jj < $1_dim1; ++jj) dp[jj] = ip[jj];
}
}
/* -----------------------------------------------------------------------------
* Runtime code
* ----------------------------------------------------------------------------- */
/* The SwigValueWrapper class */
/*
* This template wrapper is used to handle C++ objects that are passed or
* returned by value. This is necessary to handle objects that define
* no default-constructor (making it difficult for SWIG to properly declare
* local variables).
*
* The wrapper is used as follows. First consider a function like this:
*
* Vector cross_product(Vector a, Vector b)
*
* Now, if Vector is defined as a C++ class with no default constructor,
* code is generated as follows:
*
* Vector *wrap_cross_product(Vector *inarg1, Vector *inarg2) {
* SwigValueWrapper<Vector> arg1;
* SwigValueWrapper<Vector> arg2;
* SwigValueWrapper<Vector> result;
*
* arg1 = *inarg1;
* arg2 = *inarg2;
* ...
* result = cross_product(arg1,arg2);
* ...
* return new Vector(result);
* }
*
* In the wrappers, the template SwigValueWrapper simply provides a thin
* layer around a Vector *. However, it does this in a way that allows
* the object to be bound after the variable declaration (which is not possible
* with the bare object when it lacks a default constructor).
*
* An observant reader will notice that the code after the variable declarations
* is *identical* to the code used for classes that do define default constructors.
* Thus, this neat trick allows us to fix this special case without having to
* make massive changes to typemaps and other parts of the SWIG code generator.
*
* Note: this code is not included when SWIG runs in C-mode, when classes
* define default constructors, or when pointers and references are used.
* SWIG tries to avoid doing this except in very special circumstances.
*
* Note: This solution suffers from making a large number of copies
* of the underlying object. However, this is needed in the interest of
* safety and in order to cover all of the possible ways in which a value
* might be assigned. For example:
*
* arg1 = *inarg1; // Assignment from a pointer
* arg1 = Vector(1,2,3); // Assignment from a value
*
* The class offers a strong guarantee of exception safety.
* With regards to the implementation, the private SwigMovePointer nested class is
* a simple smart pointer with move semantics, much like std::auto_ptr.
*
* This wrapping technique was suggested by William Fulton and is henceforth
* known as the "Fulton Transform" :-).
*/
/* The swiglabels */
%insert("runtime") "swiglabels.swg"
%endoffile
%includefile "/usr/share/swig/4.0.0/python/python.swg" %beginfile
/* ------------------------------------------------------------
* python.swg
*
* Python configuration module.
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* Inner macros
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pymacros.swg" %beginfile
%includefile "/usr/share/swig/4.0.0/typemaps/swigmacros.swg" %beginfile
/* -----------------------------------------------------------------------------
* SWIG API. Portion only visible from SWIG
* ----------------------------------------------------------------------------- */
/*
This file implements the internal macros of the 'SWIG API', which
are useful to implement all the SWIG target languages.
Basic preprocessor macros:
--------------------------
%arg(Arg) Safe argument wrap
%str(Arg) Stringify the argument
%begin_block Begin an execution block
%end_block End an execution block
%block(Block) Execute Block as an execution block
%define_as(Def, Val) Define 'Def' as 'Val', expanding Def and Val first
%ifcplusplus(V1, V2) if C++ Mode; then V1; else V2; fi
Casting Operations:
-------------------
SWIG provides the following casting macros, which implement the
corresponding C++ casting operations:
%const_cast(a, Type) const_cast<Type >(a)
%static_cast(a, Type) static_cast<Type >(a)
%reinterpret_cast(a, Type) reinterpret_cast<Type >(a)
%numeric_cast(a, Type) static_cast<Type >(a)
%as_voidptr(a) const_cast<void *>(static_cast<const void *>(a))
%as_voidptrptr(a) reinterpret_cast<void **>(a)
or their C unsafe versions. In C++ we use the safe version unless
SWIG_NO_CPLUSPLUS_CAST is defined
Memory allocation:
------------------
These allocation/freeing macros are safe to use in C or C++ and
dispatch the proper new/delete/delete[] or free/malloc calls as
needed.
%new_instance(Type) Allocate a new instance of given Type
%new_copy(value,Type) Allocate and initialize a new instance with 'value'
%new_array(size,Type) Allocate a new array with given size and Type and zero initialize
%new_copy_array(cptr,size,Type) Allocate and initialize a new array from 'cptr'
%delete(cptr) Delete an instance
%delete_array(cptr) Delete an array
Auxiliary loop macros:
----------------------
%formacro(Macro, Args...) or %formacro_1(Macro, Args...)
for i in Args
do
Macro($i)
done
%formacro_2(Macro2, Args...)
for i,j in Args
do
Macro2($i, $j)
done
Flags and conditional macros:
-----------------------------
%mark_flag(flag)
flag := True
%evalif(flag,expr)
if flag; then
expr
fi
%evalif_2(flag1 flag2,expr)
if flag1 and flag2; then
expr
fi
*/
/* -----------------------------------------------------------------------------
* Basic preprocessor macros
* ----------------------------------------------------------------------------- */
/* define a new macro */
/* include C++ or else value */
/* insert the SWIGVERSION in the interface and the wrapper code */
%insert("header") {
#define SWIGVERSION 0x040000
#define SWIG_VERSION SWIGVERSION
}
/* -----------------------------------------------------------------------------
* Casting operators
* ----------------------------------------------------------------------------- */
%insert("header") {
#define SWIG_as_voidptr(a) (void *)((const void *)(a))
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
}
/* -----------------------------------------------------------------------------
* Allocating/freeing elements
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* SWIG names and mangling
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Auxiliary loop macros
* ----------------------------------------------------------------------------- */
/* for loop for macro with one argument */
/* for loop for macro with one argument */
/* for loop for macro with two arguments */
/* for loop for macro with two arguments */
/* -----------------------------------------------------------------------------
* SWIG flags
* ----------------------------------------------------------------------------- */
/*
mark a flag, ie, define a macro name but ignore it in
the interface.
the flag can be later used with %evalif
*/
/*
%evalif and %evalif_2 are use to evaluate or process
an expression if the given predicate is 'true' (1).
*/
%endoffile
%endoffile
/* ------------------------------------------------------------
* The runtime part
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyruntime.swg" %beginfile
%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 <math.h>
#endif
#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
/* Use debug wrappers with the Python release dll */
# undef _DEBUG
# include <Python.h>
# define _DEBUG 1
#else
# include <Python.h>
#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 */
%endoffile
/* ------------------------------------------------------------
* Special user directives
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyuserdir.swg" %beginfile
/* -------------------------------------------------------------------------
* Special user directives
* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* shadow code */
/* ------------------------------------------------------------------------- */
/*
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
*/
/* ------------------------------------------------------------------------- */
/*
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.
*/
/* ------------------------------------------------------------------------- */
/*
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.
*/
/* ------------------------------------------------------------------------- */
/*
Support for the old %callback directive name
*/
/* ------------------------------------------------------------------------- */
/*
Thread support - Advance control
*/
/* ------------------------------------------------------------------------- */
/*
Implicit Conversion using the C++ constructor mechanism
*/
/* ------------------------------------------------------------------------- */
/*
Enable keywords parameters
*/
/* ------------------------------------------------------------------------- */
/*
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
*/
/* ------------------------------------------------------------------------- */
/*
%extend_smart_pointer extend the smart pointer support.
For example, if you have a smart pointer as:
template <class Type> class RCPtr {
public:
...
RCPtr(Type *p);
Type * operator->() const;
...
};
you use the %extend_smart_pointer directive as:
%extend_smart_pointer(RCPtr<A>);
%template(RCPtr_A) RCPtr<A>;
then, if you have something like:
RCPtr<A> make_ptr();
int foo(A *);
you can do the following:
a = make_ptr();
b = foo(a);
ie, swig will accept a RCPtr<A> object where a 'A *' is
expected.
Also, when using vectors
%extend_smart_pointer(RCPtr<A>);
%template(RCPtr_A) RCPtr<A>;
%template(vector_A) std::vector<RCPtr<A> >;
you can type
a = A();
v = vector_A(2)
v[0] = a
ie, an 'A *' object is accepted, via implicit conversion,
where a RCPtr<A> object is expected. Additionally
x = v[0]
returns (and sets 'x' as) a copy of v[0], making reference
counting possible and consistent.
*/
%endoffile
/* ------------------------------------------------------------
* Typemap specializations
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pytypemaps.swg" %beginfile
/* ------------------------------------------------------------
* Typemap specializations for Python
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* Fragment section
* ------------------------------------------------------------ */
/* Include fundamental fragment definitions */
%includefile "/usr/share/swig/4.0.0/typemaps/fragments.swg" %beginfile
/*
Fragments
=========
See the "Typemap fragments" section in the documentation for understanding
fragments. Below is some info on how fragments and automatic type
specialization is used.
Macros that make the automatic generation of typemaps easier are provided.
Consider the following code:
%fragment(SWIG_From_frag(bool), "header") {
static PyObject*
SWIG_From_dec(bool)(bool value)
{
PyObject *obj = value ? Py_True : Py_False;
Py_INCREF(obj);
return obj;
}
}
%typemap(out, fragment=SWIG_From_frag(bool)) bool {
$result = SWIG_From(bool)($1));
}
Here the macros
SWIG_From_frag => fragment
SWIG_From_dec => declaration
SWIG_From => call
allow you to define/include a fragment, and declare and call the
'from-bool' method as needed. In the simpler case, these macros
just return something like
SWIG_From_frag(bool) => "SWIG_From_bool"
SWIG_From_dec(bool) => SWIG_From_bool
SWIG_From(bool) => SWIG_From_bool
But they are specialized for the different languages requirements,
such as perl or tcl that requires passing the interpreter pointer,
and also they can manage C++ ugly types, for example:
SWIG_From_frag(std::complex<double>) => "SWIG_From_std_complex_Sl_double_Sg_"
SWIG_From_dec(std::complex<double>) => SWIG_From_std_complex_Sl_double_Sg_
SWIG_From(std::complex<double>) => SWIG_From_std_complex_Sl_double_Sg_
Hence, to declare methods to use with typemaps, always use the
SWIG_From* macros. In the same way, the SWIG_AsVal* and SWIG_AsPtr*
set of macros are provided.
*/
/* -----------------------------------------------------------------------------
* Define the basic macros to 'normalize' the type fragments
* ----------------------------------------------------------------------------- */
/* ------------------------------------------------------------
* common fragments
* ------------------------------------------------------------ */
%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{
/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
#ifndef SWIG_isfinite
/* isfinite() is a macro for C99 */
# if defined(isfinite)
# define SWIG_isfinite(X) (isfinite(X))
# elif defined(__cplusplus) && __cplusplus >= 201103L
/* Use a template so that this works whether isfinite() is std::isfinite() or
* in the global namespace. The reality seems to vary between compiler
* versions.
*
* Make sure namespace std exists to avoid compiler warnings.
*
* extern "C++" is required as this fragment can end up inside an extern "C" { } block
*/
namespace std { }
extern "C++" template<typename T>
inline int SWIG_isfinite_func(T x) {
using namespace std;
return isfinite(x);
}
# define SWIG_isfinite(X) (SWIG_isfinite_func(X))
# elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
# define SWIG_isfinite(X) (__builtin_isfinite(X))
# elif defined(__clang__) && defined(__has_builtin)
# if __has_builtin(__builtin_isfinite)
# define SWIG_isfinite(X) (__builtin_isfinite(X))
# endif
# elif defined(_MSC_VER)
# define SWIG_isfinite(X) (_finite(X))
# elif defined(__sun) && defined(__SVR4)
# include <ieeefp.h>
# define SWIG_isfinite(X) (finite(X))
# endif
#endif
%}
%fragment("SWIG_Float_Overflow_Check","header",fragment="<float.h>,SWIG_isfinite") %{
/* Accept infinite as a valid float value unless we are unable to check if a value is finite */
#ifdef SWIG_isfinite
# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X))
#else
# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX))
#endif
%}
/* -----------------------------------------------------------------------------
* special macros for fragments
* ----------------------------------------------------------------------------- */
/* Macros to derive numeric types */
/* Macro for 'signed long' derived types */
/* Macro for 'unsigned long' derived types */
/* Macro for floating point derived types (original macro) */
/* Macro for floating point derived types */
/* Macros for missing fragments */
%endoffile
/* Look for user fragments file. */
%includefile "/usr/share/swig/4.0.0/python/pyfragments.swg" %beginfile
/*
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)
{
<your code here>;
}
}
this will replace the code used to retrieve an integer value for all
the typemaps that need it, including:
int, std::vector<int>, std::list<std::pair<int,int> >, etc.
*/
%endoffile
/* Python fragments for fundamental types */
%includefile "/usr/share/swig/4.0.0/python/pyprimtypes.swg" %beginfile
/* ------------------------------------------------------------
* Primitive Types
* ------------------------------------------------------------ */
/* boolean */
%fragment("SWIG_" "From" "_" {bool},"header") {
SWIGINTERNINLINE PyObject*
SWIG_From_bool (bool value)
{
return PyBool_FromLong(value ? 1 : 0);
}
}
%fragment("SWIG_" "AsVal" "_" {bool},"header",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_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;
}
}
/* int */
%fragment("SWIG_" "From" "_" {int},"header") {
SWIGINTERNINLINE PyObject*
SWIG_From_int (int value)
{
return PyInt_FromLong((long) value);
}
}
/* unsigned int */
%fragment("SWIG_" "From" "_" {unsigned int},"header") {
SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_int (unsigned int value)
{
return PyInt_FromSize_t((size_t) value);
}
}
/* long */
%fragment("SWIG_" "From" "_" {long},"header") {
#define SWIG_From_long PyInt_FromLong
}
%fragment("SWIG_" "AsVal" "_" {long},"header",
fragment="SWIG_CanCastAsInteger") {
SWIGINTERN int
SWIG_AsVal_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" "_" {unsigned long},"header",
fragment="SWIG_" "From" "_" {long}) {
SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long (unsigned long value)
{
return (value > LONG_MAX) ?
PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value));
}
}
%fragment("SWIG_" "AsVal" "_" {unsigned long},"header",
fragment="SWIG_CanCastAsInteger") {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_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" "_" {long long},"header",
fragment="SWIG_LongLongAvailable") {
#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERNINLINE PyObject*
SWIG_From_long_SS_long (long long value)
{
return ((value < LONG_MIN) || (value > LONG_MAX)) ?
PyLong_FromLongLong(value) : PyInt_FromLong((long)(value));
}
#endif
}
%fragment("SWIG_" "AsVal" "_" {long long},"header",
fragment="SWIG_" "AsVal" "_" {long},
fragment="SWIG_CanCastAsInteger",
fragment="SWIG_LongLongAvailable") {
#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERN int
SWIG_AsVal_long_SS_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" "_" {unsigned long long},"header",
fragment="SWIG_LongLongAvailable") {
#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
{
return (value > LONG_MAX) ?
PyLong_FromUnsignedLongLong(value) : PyInt_FromLong((long)(value));
}
#endif
}
%fragment("SWIG_" "AsVal" "_" {unsigned long long},"header",
fragment="SWIG_" "AsVal" "_" {unsigned long},
fragment="SWIG_CanCastAsInteger",
fragment="SWIG_LongLongAvailable") {
#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERN int
SWIG_AsVal_unsigned_SS_long_SS_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_SS_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" "_" {double},"header") {
#define SWIG_From_double PyFloat_FromDouble
}
%fragment("SWIG_" "AsVal" "_" {double},"header") {
SWIGINTERN int
SWIG_AsVal_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;
}
}
%endoffile
/* Python fragments for char* strings */
%includefile "/usr/share/swig/4.0.0/python/pystrings.swg" %beginfile
/* ------------------------------------------------------------
* 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
PyBytes_AsStringAndSize(obj, &cstr, &len);
#else
PyString_AsStringAndSize(obj, &cstr, &len);
#endif
if (cptr) {
if (alloc) {
if (*alloc == SWIG_NEWOBJ) {
*cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
*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 = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
}
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((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void();
} else {
#if PY_VERSION_HEX >= 0x03000000
#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size));
#else
return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape");
#endif
#else
return PyString_FromStringAndSize(carray, (Py_ssize_t)(size));
#endif
}
} else {
return SWIG_Py_Void();
}
}
}
%endoffile
/* Backward compatibility output helper */
%fragment("t_output_helper","header") %{
#define t_output_helper SWIG_Python_AppendOutput
%}
/* ------------------------------------------------------------
* Unified typemap section
* ------------------------------------------------------------ */
/* directors are supported in Python */
/* Python types */
/* Python allows implicit conversion */
/* Overload of the output/constant/exception/dirout handling */
/* append output */
/* set constant */
/* raise */
/* Include the unified typemap library */
%includefile "/usr/share/swig/4.0.0/typemaps/swigtypemaps.swg" %beginfile
/* -----------------------------------------------------------------------------
* swigtypemaps.swg
*
* Unified Typemap Library frontend
* ----------------------------------------------------------------------------- */
/*
This file provides the frontend to the Unified Typemap Library.
When using this library in a SWIG target language, you need to
define a minimum set of fragments, specialize a couple of macros,
and then include this file.
Typically you will create a 'mytypemaps.swg' file in each target
language, where you will have the following sections:
=== mytypemaps.swg ===
// Fragment section
%include <typemaps/fragments.swg>
<include target language fragments>
// Unified typemap section
<specialized the typemap library macros>
%include <typemaps/swigtypemaps.swg>
// Local typemap section
<add/replace extra target language typemaps>
=== mytypemaps.swg ===
While we add more docs, please take a look at the following cases
to see how you specialized the unified typemap library for a new
target language:
Lib/python/pytypemaps.swg
Lib/tcl/tcltypemaps.swg
Lib/ruby/rubytypemaps.swg
Lib/perl5/perltypemaps.swg
*/
/* -----------------------------------------------------------------------------
* Language specialization section.
*
* Tune these macros for each language as needed.
* ----------------------------------------------------------------------------- */
/*
The SWIG target language object must be provided.
For example in python you define:
#define SWIG_Object PyObject *
*/
/*==== flags for new/convert methods ====*/
/*==== set output ====*/
/* simple set output operation */
/*==== set variable output ====*/
/* simple set varoutput operation */
/*==== append output ====*/
/* simple append operation */
/*==== set constant ====*/
/* simple set constant operation */
/*==== raise an exception ====*/
/* simple raise operation */
/*==== director output exception ====*/
/* -----------------------------------------------------------------------------
* Language independent definitions
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* All the typemaps
* ----------------------------------------------------------------------------- */
%includefile "/usr/share/swig/4.0.0/typemaps/exception.swg" %beginfile
/* -----------------------------------------------------------------------------
* exceptions.swg
*
* This SWIG library file provides language independent exception handling
* ----------------------------------------------------------------------------- */
/* macros for error manipulation */
/* setting an error */
%insert("runtime") {
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
}
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/swigtype.swg" %beginfile
/* -----------------------------------------------------------------------------
* --- Input arguments ---
* ----------------------------------------------------------------------------- */
/* Pointers and arrays */
%typemap(in, noblock=1) SWIGTYPE *(void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp,$descriptor, $disown | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($ltype)(argp);
}
%typemap(freearg) SWIGTYPE * "";
%typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp,$descriptor, $disown | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($ltype)(argp);
}
%typemap(freearg) SWIGTYPE [] "";
%typemap(in, noblock=1) SWIGTYPE *const& (void *argp = 0, int res = 0, $*1_ltype temp) {
res = SWIG_ConvertPtr($input, &argp, $*descriptor, $disown | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(argp);
$1 = ($1_ltype)(&temp);
}
%typemap(freearg) SWIGTYPE *const& "";
/* Reference */
%typemap(in, noblock=1) SWIGTYPE & (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'"); }
$1 = ($ltype)(argp);
}
%typemap(freearg) SWIGTYPE & "";
%typemap(in,noblock=1) const SWIGTYPE & (void *argp, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'"); }
$1 = ($ltype)(argp);
}
/* Rvalue reference */
%typemap(in, noblock=1) SWIGTYPE && (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'"); }
$1 = ($ltype)(argp);
}
%typemap(freearg) SWIGTYPE && "";
%typemap(in,noblock=1) const SWIGTYPE && (void *argp, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'"); }
$1 = ($ltype)(argp);
}
/* By value */
%typemap(in) SWIGTYPE (void *argp, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $&descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
} else {
$1 = *(($&ltype)(argp));
}
}
/* -----------------------------------------------------------------------------
* --- Output arguments ---
* ----------------------------------------------------------------------------- */
/* Pointers, references */
%typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE[] {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, $owner | 0 );
}
%typemap(out, noblock=1) SWIGTYPE *const& {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*descriptor, $owner | 0 );
}
/* Return by value */
%typemap(out, noblock=1) SWIGTYPE {
$result = SWIG_NewPointerObj(($ltype *)memcpy(($ltype *)calloc(1,sizeof($ltype)),&$1,sizeof($ltype)), $&descriptor, SWIG_POINTER_OWN | 0 );
}
/* -----------------------------------------------------------------------------
* --- Variable input ---
* ----------------------------------------------------------------------------- */
/* memberin/globalin/varin, for fix arrays. */
%typemap(memberin) SWIGTYPE [ANY] {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)$input + ii);
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
%typemap(globalin) SWIGTYPE [ANY] {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)$input + ii);
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
%typemap(varin) SWIGTYPE [ANY] {
$basetype *inp = 0;
int res = SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&inp), $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
} else if (inp) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)inp + ii);
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
/* memberin/globalin/varin, for fix double arrays. */
%typemap(memberin) SWIGTYPE [ANY][ANY] {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) {
if ($input[ii]) {
size_t jj = 0;
for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj];
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
%typemap(globalin) SWIGTYPE [ANY][ANY] {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) {
if ($input[ii]) {
size_t jj = 0;
for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj];
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
%typemap(varin) SWIGTYPE [ANY][ANY] {
$basetype (*inp)[$1_dim1] = 0;
int res = SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&inp), $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
} else if (inp) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) {
if (inp[ii]) {
size_t jj = 0;
for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = inp[ii][jj];
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
/* Pointers, references, and variable size arrays */
%typemap(varin,warning= "454:Setting a pointer/reference variable may leak memory." ) SWIGTYPE * {
void *argp = 0;
int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(argp);
}
%typemap(varin,noblock=1,warning="462:Unable to set dimensionless array variable") SWIGTYPE []
{
SWIG_exception_fail(SWIG_ArgError(SWIG_AttributeError), "in variable '""read-only $name""' of type '""$type""'");
}
%typemap(varin,warning= "454:Setting a pointer/reference variable may leak memory." ) SWIGTYPE & {
void *argp = 0;
int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if (!argp) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
$1 = *(($ltype)(argp));
}
%typemap(varin,warning= "454:Setting a pointer/reference variable may leak memory." ) SWIGTYPE && {
void *argp = 0;
int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if (!argp) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
$1 = *(($ltype)(argp));
}
%typemap(varin) SWIGTYPE {
void *argp = 0;
int res = SWIG_ConvertPtr($input, &argp, $&descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if (!argp) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
} else {
$1 = *(($&type)(argp));
}
}
/* -----------------------------------------------------------------------------
* --- Variable output ---
* ----------------------------------------------------------------------------- */
/* Pointers and arrays */
%typemap(varout, noblock=1) SWIGTYPE * {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, 0 );
}
%typemap(varout, noblock=1) SWIGTYPE [] {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, 0 );
}
/* References */
%typemap(varout, noblock=1) SWIGTYPE & {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $descriptor, 0 );
}
%typemap(varout, noblock=1) SWIGTYPE && {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $descriptor, 0 );
}
/* Value */
%typemap(varout, noblock=1) SWIGTYPE {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $&descriptor, 0 );
}
/* ------------------------------------------------------------
* --- Typechecking rules ---
* ------------------------------------------------------------ */
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE * {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE *const& {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $*descriptor, 0);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE & {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE && {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) const SWIGTYPE & {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) const SWIGTYPE && {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $&descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
/* -----------------------------------------------------------------------------
* --- Director typemaps --- *
* ----------------------------------------------------------------------------- */
/* directorin */
%typemap(directorin,noblock=1) SWIGTYPE {
$input = SWIG_NewPointerObj(SWIG_as_voidptr(new $1_ltype((const $1_ltype &)$1)), $&descriptor, SWIG_POINTER_OWN | 0 );
}
%typemap(directorin,noblock=1) SWIGTYPE * {
$input = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, 0 );
}
%typemap(directorin,noblock=1) SWIGTYPE *const& {
$input = SWIG_NewPointerObj(SWIG_as_voidptr($1), $*descriptor, 0 );
}
%typemap(directorin,noblock=1) SWIGTYPE & {
$input = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $descriptor, 0 );
}
%typemap(directorin,noblock=1) SWIGTYPE && {
$input = SWIG_NewPointerObj(SWIG_as_voidptr(&$1_name), $descriptor, 0 );
}
/* directorout */
%typemap(directorout,noblock=1) SWIGTYPE (void * swig_argp, int swig_res = 0) {
swig_res = SWIG_ConvertPtr($input,&swig_argp,$&descriptor, 0 );
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = *(($&ltype)(swig_argp));
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." )
SWIGTYPE *(void *swig_argp, int swig_res, swig_owntype own) {
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, 0 | SWIG_POINTER_DISOWN, &own);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($ltype)(swig_argp);
swig_acquire_ownership_obj(SWIG_as_voidptr($result), own /* & TODO: SWIG_POINTER_OWN */);
}
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE * {
if (director) {
SWIG_AcquirePtr($result, director->swig_release_ownership(SWIG_as_voidptr($input)));
}
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." )
SWIGTYPE *const&(void *swig_argp, int swig_res, swig_owntype own) {
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $*descriptor, 0 | SWIG_POINTER_DISOWN, &own);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$1_ltype swig_temp = new $*1_ltype(($*1_ltype)swig_argp);
swig_acquire_ownership(swig_temp);
$result = swig_temp;
}
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE *const& {
if (director) {
SWIG_AcquirePtr($result, director->swig_release_ownership(SWIG_as_voidptr(*$input)));
}
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." )
SWIGTYPE &(void *swig_argp, int swig_res, swig_owntype own) {
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, 0 | SWIG_POINTER_DISOWN, &own);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
if (!swig_argp) { Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ValueError), "invalid null reference " "in output value of type '""$type""'"); }
$result = ($ltype)(swig_argp);
swig_acquire_ownership_obj(SWIG_as_voidptr($result), own /* & TODO: SWIG_POINTER_OWN */);
}
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE & {
if (director) {
SWIG_AcquirePtr($result, director->swig_release_ownership(SWIG_as_voidptr($input)));
}
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." )
SWIGTYPE &&(void *swig_argp, int swig_res, swig_owntype own) {
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, 0 | SWIG_POINTER_DISOWN, &own);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
if (!swig_argp) { Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ValueError), "invalid null reference " "in output value of type '""$type""'"); }
$result = ($ltype)(swig_argp);
swig_acquire_ownership_obj(SWIG_as_voidptr($result), own /* & TODO: SWIG_POINTER_OWN */);
}
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE && {
if (director) {
SWIG_AcquirePtr($result, director->swig_release_ownership(SWIG_as_voidptr($input)));
}
}
/* ------------------------------------------------------------
* --- Constants ---
* ------------------------------------------------------------ */
%typemap(constcode,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] {
SWIG_Python_SetConstant(d, "$symname",SWIG_NewPointerObj(SWIG_as_voidptr($value),$descriptor, 0 ));
}
%typemap(constcode,noblock=1) SWIGTYPE {
SWIG_Python_SetConstant(d, "$symname",SWIG_NewPointerObj(SWIG_as_voidptr(&$value),$&descriptor, 0 ));
}
/* ------------------------------------------------------------
* --- Exception handling ---
* ------------------------------------------------------------ */
%typemap(throws,noblock=1) SWIGTYPE {
SWIG_Python_Raise(SWIG_NewPointerObj(($ltype *)memcpy(($ltype *)calloc(1,sizeof($ltype)),&$1,sizeof($ltype)),$&descriptor,SWIG_POINTER_OWN), "$type", $&descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) SWIGTYPE * {
SWIG_Python_Raise(SWIG_NewPointerObj(SWIG_as_voidptr($1),$descriptor,0), "$type", $descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) SWIGTYPE [ANY] {
SWIG_Python_Raise(SWIG_NewPointerObj(SWIG_as_voidptr($1),$descriptor,0), "$type", $descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) SWIGTYPE & {
SWIG_Python_Raise(SWIG_NewPointerObj(SWIG_as_voidptr(&$1),$descriptor,0), "$type", $descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) SWIGTYPE && {
SWIG_Python_Raise(SWIG_NewPointerObj(SWIG_as_voidptr(&$1),$descriptor,0), "$type", $descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) (...) {
SWIG_exception_fail(SWIG_RuntimeError,"unknown exception");
}
/* ------------------------------------------------------------
* --- CLASS::* typemaps ---
* ------------------------------------------------------------ */
%typemap(in) SWIGTYPE (CLASS::*) {
int res = SWIG_ConvertMember($input, SWIG_as_voidptr(&$1), sizeof($type),$descriptor);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
}
%typemap(out,noblock=1) SWIGTYPE (CLASS::*) {
$result = SWIG_NewMemberObj(SWIG_as_voidptr(&$1), sizeof($type), $descriptor);
}
%typemap(varin) SWIGTYPE (CLASS::*) {
int res = SWIG_ConvertMember($input,SWIG_as_voidptr(&$1), sizeof($type), $descriptor);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
}
%typemap(varout,noblock=1) SWIGTYPE (CLASS::*) {
$result = SWIG_NewMemberObj(SWIG_as_voidptr(&$1), sizeof($type), $descriptor);
}
%typemap(constcode,noblock=1) SWIGTYPE (CLASS::*) {
SWIG_Python_SetConstant(d, "$symname",SWIG_NewMemberObj(SWIG_as_voidptr(&$value), sizeof($type), $descriptor));
}
/* directorin */
%typemap(directorin,noblock=1) SWIGTYPE (CLASS::*) {
$input = SWIG_NewMemberObj(SWIG_as_voidptr(&$1), sizeof($type), $descriptor);
}
/* directorout */
%typemap(directorout) SWIGTYPE (CLASS::*) {
int swig_res = SWIG_ConvertMember($input,SWIG_as_voidptr(&$result), sizeof($type), $descriptor);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
}
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* ------------------------------------------------------------
* --- function ptr typemaps ---
* ------------------------------------------------------------ */
/*
ISO C++ doesn't allow direct casting of a function ptr to a object
ptr. So, maybe the ptr sizes are not the same, and we need to take
some providences.
*/
%typemap(in) SWIGTYPE ((*)(ANY)) {
int res = SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
}
%typemap(typecheck, precedence= 0 ,noblock=1) SWIGTYPE ((*)(ANY)) {
void *ptr = 0;
int res = SWIG_ConvertFunctionPtr($input, &ptr, $descriptor);
$1 = SWIG_CheckState(res);
}
%typemap(out, noblock=1) SWIGTYPE ((*)(ANY)) {
$result = SWIG_NewFunctionPtrObj((void *)($1), $descriptor);
}
%typemap(varin) SWIGTYPE ((*)(ANY)) {
int res = SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
}
%typemap(varout,noblock=1) SWIGTYPE ((*)(ANY)) {
$result = SWIG_NewFunctionPtrObj((void *)($1), $descriptor);
}
%typemap(constcode, noblock=1) SWIGTYPE ((*)(ANY)){
SWIG_Python_SetConstant(d, "$symname",SWIG_NewFunctionPtrObj((void *)$value, $descriptor));
}
%typemap(constcode) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY));
/* directorin */
%typemap(directorin,noblock=1) SWIGTYPE ((*)(ANY)) {
$input = SWIG_NewFunctionPtrObj((void*)($1), $descriptor);
}
/* directorout */
%typemap(directorout) SWIGTYPE ((*)(ANY)) {
int swig_res = SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
}
%apply SWIGTYPE ((*)(ANY)) { SWIGTYPE ((* const)(ANY)) }
%apply SWIGTYPE * { SWIGTYPE *const }
/* ------------------------------------------------------------
* --- Special typemaps ---
* ------------------------------------------------------------ */
/* DISOWN typemap */
%typemap(in, noblock=1) SWIGTYPE *DISOWN (int res = 0) {
res = SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
}
%typemap(varin) SWIGTYPE *DISOWN {
void *temp = 0;
int res = SWIG_ConvertPtr($input, &temp, $descriptor, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype) temp;
}
/* DYNAMIC typemap */
%typemap(out,noblock=1) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIG_TypeDynamicCast($descriptor, SWIG_as_voidptrptr(&$1)), $owner | 0 );
}
/* INSTANCE typemap */
%typemap(out,noblock=1) SWIGTYPE INSTANCE {
$result = SWIG_NewInstanceObj(($1_ltype *)memcpy(($1_ltype *)calloc(1,sizeof($1_ltype)),&$1,sizeof($1_ltype)), $&1_descriptor, SWIG_POINTER_OWN | 0 );
}
%typemap(out,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE &INSTANCE, SWIGTYPE INSTANCE[] {
$result = SWIG_NewInstanceObj(SWIG_as_voidptr($1), $1_descriptor, $owner | 0 );
}
%typemap(varout,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE INSTANCE[] {
$result = SWIG_NewInstanceObj(SWIG_as_voidptr($1), $1_descriptor, 0 );
}
%typemap(varout,noblock=1) SWIGTYPE &INSTANCE {
$result = SWIG_NewInstanceObj(SWIG_as_voidptr($1), $1_descriptor, 0 );
}
%typemap(varout,noblock=1) SWIGTYPE INSTANCE {
$result = SWIG_NewInstanceObj(SWIG_as_voidptr(&$1), $&1_descriptor, 0 );
}
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/void.swg" %beginfile
/* ------------------------------------------------------------
* Void * - Accepts any kind of pointer
* ------------------------------------------------------------ */
/* in */
%typemap(in,noblock=1) void * (int res) {
res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1), 0, $disown);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
}
%typemap(freearg) void * "";
%typemap(in,noblock=1) void * const& ($*ltype temp = 0, int res) {
res = SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&temp), 0, $disown);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "Stype""'");
}
$1 = &temp;
}
%typemap(freearg) void * const& "";
/* out */
%typemap(out,noblock=1) void { $result = SWIG_Py_Void(); }
/* varin */
%typemap(varin) void * {
void *temp = 0;
int res = SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($1_ltype) temp;
}
/* typecheck */
%typemap(typecheck, precedence= 10 ,noblock=1) void *
{
void *ptr = 0;
int res = SWIG_ConvertPtr($input, &ptr, 0, 0);
$1 = SWIG_CheckState(res);
}
/* directorin */
%typemap(directorin,noblock=1) void *, void const*, void *const, void const *const,
void const *&, void *const &, void const *const & {
$input = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, 0 );
}
/* directorout */
%typemap(directorout,noblock=1) void * (void *argp, int res) {
res = SWIG_ConvertPtr($input, &argp, 0, 0);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
$result = ($ltype)(argp);
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." ) void * const& (void *argp, int res) {
res = SWIG_ConvertPtr($input, &argp, 0, $disown);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
static $*ltype temp = ($*ltype)(argp);
$result = &temp;
}
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/swigobject.swg" %beginfile
/* ------------------------------------------------------------
* Language Object * - Just pass straight through unmodified
* ------------------------------------------------------------ */
%typemap(in) PyObject * "$1 = $input;";
%typemap(in,noblock=1) PyObject * const & ($*ltype temp)
{
temp = ($*ltype)($input);
$1 = &temp;
}
%typemap(out,noblock=1) PyObject * {
$result = $1;
}
%typemap(out,noblock=1) PyObject * const & {
$result = *$1;
}
%typemap(typecheck, precedence= 5000 ) PyObject * "$1 = ($input != 0);";
%typemap(throws,noblock=1) PyObject * {
SWIG_Python_Raise($1, "$type", 0); SWIG_fail;
}
%typemap(constcode,noblock=1) PyObject * {
SWIG_Python_SetConstant(d, "$symname",$value);
}
%typemap(directorin) PyObject * "$input = $1;";
%typemap(directorout) PyObject * "$result = $input;";
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/valtypes.swg" %beginfile
/*---------------------------------------------------------------------
* Value typemaps (Type, const Type&) for value types, such as
* fundamental types (int, double), that define the AsVal/From
* methods.
*
* To apply them, just use one of the following macros:
*
* %typemaps_from(FromMeth, FromFrag, Type)
* %typemaps_asval(CheckCode, AsValMeth, AsValFrag, Type)
* %typemaps_asvalfrom(CheckCode, AsValMeth, FromMeth, AsValFrag, FromFrag, Type)
*
* or the simpler and normalize form:
*
* %typemaps_asvalfromn(CheckCode, Type)
*
* Also, you can use the individual typemap definitions:
*
* %value_in_typemap(asval_meth,frag,Type)
* %value_varin_typemap(asval_meth,frag,Type)
* %value_typecheck_typemap(checkcode,asval_meth,frag,Type)
* %value_directorout_typemap(asval_meth,frag,Type)
*
* %value_out_typemap(from_meth,frag,Type)
* %value_varout_typemap(from_meth,frag,Type)
* %value_constcode_typemap(from_meth,frag,Type)
* %value_directorin_typemap(from_meth,frag,Type)
* %value_throws_typemap(from_meth,frag,Type)
*
*---------------------------------------------------------------------*/
/* in */
/* out */
/* varin */
/* varout */
/* constant installation code */
/* directorin */
/* directorout */
/* throws */
/* typecheck */
/*---------------------------------------------------------------------
* typemap definition for types with AsVal methods
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with from method
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with alval/from method
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with for 'normalized' asval/from methods
*---------------------------------------------------------------------*/
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/ptrtypes.swg" %beginfile
/* -----------------------------------------------------------------------------
* ptrtypes.swg
*
* Value typemaps (Type, const Type&) for "Ptr" types, such as swig
* wrapped classes, that define the AsPtr/From methods
*
* To apply them, just use one of the following macros:
*
* %typemaps_asptr(CheckCode, AsPtrMeth, AsPtrFrag, Type)
* %typemaps_asptrfrom(CheckCode, AsPtrMeth, FromMeth, AsPtrFrag, FromFrag, Type)
*
* or the simpler and normalize form:
*
* %typemaps_asptrfromn(CheckCode, Type)
*
* Also, you can use the individual typemap definitions:
*
* %ptr_in_typemap(asptr_meth,frag,Type)
* %ptr_varin_typemap(asptr_meth,frag,Type)
* %ptr_typecheck_typemap(check,asptr_meth,frag,Type)
* %ptr_directorout_typemap(asptr_meth,frag,Type)
* ----------------------------------------------------------------------------- */
/* in */
/* varin */
/* directorout */
/* typecheck */
/*---------------------------------------------------------------------
* typemap definition for types with asptr method
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with asptr/from methods
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with for 'normalized' asptr/from methods
*---------------------------------------------------------------------*/
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/inoutlist.swg" %beginfile
/* ------------------------------------------------------------
*
* Define the IN/OUTPUT typemaps assuming the output parameters are
* returned in a list, i.e., they are not directly modified.
*
* The user should provide the %append_output(result, obj) method,
* via a macro, which append a particular object to the result.
*
*
* In Tcl, for example, the file is used as:
*
* #define %append_output(obj) Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),obj);
* %include <typemaps/inoutlist.swg>
*
* while in Python it is used as:
*
* #define %append_output(obj) $result = SWIG_Python_AppendResult($result, obj)
* %include <typemaps/inoutlist.swg>
*
* where the method SWIG_Python_AppendResult is defined inside the
* %append_output fragment.
*
* If you forget to define %append_output, this file will generate
* an error.
*
* ------------------------------------------------------------ */
//
// Uncomment the following definition if you don't want the in/out
// typemaps by default, ie, you prefer to use typemaps.i.
//
//#define SWIG_INOUT_NODEF
//
// Use the following definition to enable the INPUT parameters to
// accept both 'by value' and 'pointer' objects.
//
// ------------------------------------------------------------------------
// 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.
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 :
double fadd(double *INPUT, double *INPUT);
or you can use the %apply directive :
%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 list.
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 :
double modf(double x, double *OUTPUT);
or you can use the %apply directive :
%apply double *OUTPUT { double *ip };
double modf(double x, double *ip);
The output of the function would be a list 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 list.
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 :
void neg(double *INOUT);
or you can use the %apply directive :
%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 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.
*/
/*----------------------------------------------------------------------
Front ends.
use the following macros to define your own IN/OUTPUT/INOUT typemaps
------------------------------------------------------------------------*/
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/primtypes.swg" %beginfile
/* ------------------------------------------------------------
* Primitive type fragments and macros
* ------------------------------------------------------------ */
/*
This file provide fragments and macros for the C/C++ primitive types.
The file defines default fragments for the following types:
bool
signed char
unsigned char
signed wchar_t // in C++
unsigned wchar_t // in C++
short
unsigned short
int
unsigned int
float
size_t
ptrdiff_t
which can always be redefined in the swig target language if needed.
The fragments for the following types, however, always need to be
defined in the target language:
long
unsigned long
long long
unsigned long long
double
If they are not provided, an #error directive will appear in the
wrapped code.
--------------------------------------------------------------------
This file provides the macro
%typemaps_primitive(CheckCode, Type)
which generates the typemaps for a primitive type with a given
checkcode. It is assumed that the primitive type is 'normalized' and
the corresponding SWIG_AsVal(Type) and SWIG_From(Type) methods are
provided via fragments.
The following auxiliary macros (explained with bash pseudo code) are
also defined:
%apply_ctypes(Macro)
for i in C Type
do
Macro($i)
done
%apply_cpptypes(Macro)
for i in C++ Type
do
Macro($i)
done
%apply_ctypes_2(Macro2)
for i in C Type
do
for j in C Type
do
Macro_2($i, $j)
done
done
%apply_cpptypes_2(Macro2)
for i in C++ Type
do
for j in C++ Type
do
Macro_2($i, $j)
done
done
%apply_checkctypes(Macro2)
for i in Check Type
do
Macro2(%checkcode($i), $i)
done
*/
/* ------------------------------------------------------------
* Primitive type fragments
* ------------------------------------------------------------ */
/* boolean */
%fragment("SWIG_" "From" "_" {bool},"header",fragment="SWIG_" "From" "_" {long}) {
SWIGINTERN PyObject *
SWIG_From_bool (bool value)
{
return SWIG_From_long (value ? 1 : 0);
}
}
%fragment("SWIG_" "AsVal" "_" {bool},"header",fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_bool (PyObject * obj, bool *val)
{
long v;
int res = SWIG_AsVal_long (obj, val ? &v : 0);
if (SWIG_IsOK(res)) {
if (val) *val = v ? true : false;
return res;
}
return SWIG_TypeError;
}
}
/* signed/unsigned char */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,192,%numeric_slong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {signed char},"header",
fragment="SWIG_" "From" "_" {long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_signed_SS_char (signed char value)
{
return SWIG_From_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {signed char},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_signed_SS_char (PyObject * obj, signed char *val)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v < SCHAR_MIN || v > SCHAR_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (signed char)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,199,%numeric_ulong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {unsigned char},"header",
fragment="SWIG_" "From" "_" {unsigned long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_unsigned_SS_char (unsigned char value)
{
return SWIG_From_unsigned_SS_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {unsigned char},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v > UCHAR_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (unsigned char)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/* short/unsigned short */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,192,%numeric_slong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {short},"header",
fragment="SWIG_" "From" "_" {long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_short (short value)
{
return SWIG_From_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {short},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_short (PyObject * obj, short *val)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v < SHRT_MIN || v > SHRT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (short)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,199,%numeric_ulong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {unsigned short},"header",
fragment="SWIG_" "From" "_" {unsigned long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_unsigned_SS_short (unsigned short value)
{
return SWIG_From_unsigned_SS_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {unsigned short},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v > USHRT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (unsigned short)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/* int/unsigned int */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,192,%numeric_slong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {int},"header",
fragment="SWIG_" "From" "_" {long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_int (int value)
{
return SWIG_From_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {int},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_int (PyObject * obj, int *val)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v < INT_MIN || v > INT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (int)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,199,%numeric_ulong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {unsigned int},"header",
fragment="SWIG_" "From" "_" {unsigned long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_unsigned_SS_int (unsigned int value)
{
return SWIG_From_unsigned_SS_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {unsigned int},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v > UINT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (unsigned int)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/* signed/unsigned wchar_t */
/* float */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,214,%numeric_float@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {float},"header",
fragment="SWIG_" "From" "_" {double}) {
SWIGINTERNINLINE PyObject *
SWIG_From_float (float value)
{
return SWIG_From_double (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {float},"header",
fragment="SWIG_Float_Overflow_Check",
fragment="SWIG_" "AsVal" "_" {double}) {
SWIGINTERN int
SWIG_AsVal_float (PyObject * obj, float *val)
{
double v;
int res = SWIG_AsVal_double (obj, &v);
if (SWIG_IsOK(res)) {
if (SWIG_Float_Overflow_Check(v)) {
return SWIG_OverflowError;
} else {
if (val) *val = (float)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/* long/unsigned long */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {long},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(long) fragment"
}
%fragment("SWIG_" "AsVal" "_" {long},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(long) fragment"
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {unsigned long},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(unsigned long) fragment"
}
%fragment("SWIG_" "AsVal" "_" {unsigned long},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(unsigned long) fragment"
}
/*@SWIG@*/
/* long long/unsigned long long */
%fragment("SWIG_LongLongAvailable","header", fragment="<limits.h>") %{
#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
# define SWIG_LONG_LONG_AVAILABLE
#endif
%}
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {long long},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(long long) fragment"
}
%fragment("SWIG_" "AsVal" "_" {long long},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(long long) fragment"
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {unsigned long long},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(unsigned long long) fragment"
}
%fragment("SWIG_" "AsVal" "_" {unsigned long long},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(unsigned long long) fragment"
}
/*@SWIG@*/
/* double */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {double},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(double) fragment"
}
%fragment("SWIG_" "AsVal" "_" {double},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(double) fragment"
}
/*@SWIG@*/
/* size_t */
%fragment("SWIG_" "From" "_" {size_t},"header",fragment="SWIG_" "From" "_" {unsigned long},fragment="SWIG_" "From" "_" {unsigned long long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_size_t (size_t value)
{
#ifdef SWIG_LONG_LONG_AVAILABLE
if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
return SWIG_From_unsigned_SS_long ((unsigned long)(value));
#ifdef SWIG_LONG_LONG_AVAILABLE
} else {
/* assume sizeof(size_t) <= sizeof(unsigned long long) */
return SWIG_From_unsigned_SS_long_SS_long ((unsigned long long)(value));
}
#endif
}
}
%fragment("SWIG_" "AsVal" "_" {size_t},"header",fragment="SWIG_" "AsVal" "_" {unsigned long},fragment="SWIG_" "AsVal" "_" {unsigned long long}) {
SWIGINTERNINLINE int
SWIG_AsVal_size_t (PyObject * obj, size_t *val)
{
int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
unsigned long v;
res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = (size_t)(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
} else if (sizeof(size_t) <= sizeof(unsigned long long)) {
unsigned long long v;
res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = (size_t)(v);
}
#endif
return res;
}
}
/* ptrdiff_t */
%fragment("SWIG_" "From" "_" {ptrdiff_t},"header",fragment="SWIG_" "From" "_" {long},fragment="SWIG_" "From" "_" {long long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_ptrdiff_t (ptrdiff_t value)
{
#ifdef SWIG_LONG_LONG_AVAILABLE
if (sizeof(ptrdiff_t) <= sizeof(long)) {
#endif
return SWIG_From_long ((long)(value));
#ifdef SWIG_LONG_LONG_AVAILABLE
} else {
/* assume sizeof(ptrdiff_t) <= sizeof(long long) */
return SWIG_From_long_SS_long ((long long)(value));
}
#endif
}
}
%fragment("SWIG_" "AsVal" "_" {ptrdiff_t},"header",fragment="SWIG_" "AsVal" "_" {long},fragment="SWIG_" "AsVal" "_" {long long}) {
SWIGINTERNINLINE int
SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
{
int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
if (sizeof(ptrdiff_t) <= sizeof(long)) {
#endif
long v;
res = SWIG_AsVal_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = (ptrdiff_t)(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
} else if (sizeof(ptrdiff_t) <= sizeof(long long)) {
long long v;
res = SWIG_AsVal_long_SS_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = (ptrdiff_t)(v);
}
#endif
return res;
}
}
%fragment("SWIG_CanCastAsInteger","header",
fragment="SWIG_" "AsVal" "_" {double},
fragment="<float.h>",
fragment="<math.h>") {
SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double *d, double min, double max) {
double x = *d;
if ((min <= x && x <= max)) {
double fx = floor(x);
double cx = ceil(x);
double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
if ((errno == EDOM) || (errno == ERANGE)) {
errno = 0;
} else {
double summ, reps, diff;
if (rd < x) {
diff = x - rd;
} else if (rd > x) {
diff = rd - x;
} else {
return 1;
}
summ = rd + x;
reps = diff/summ;
if (reps < 8*DBL_EPSILON) {
*d = rd;
return 1;
}
}
}
return 0;
}
}
/* ------------------------------------------------------------
* Generate the typemaps for primitive type
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* Primitive Type Macros
* ------------------------------------------------------------ */
/* useful macros to derive typemap declarations from primitive types */
/* Apply macro to the C-types */
/* apply the Macro2(Type1, Type2) to all C types */
/* apply the Macro(Type) to all C++ types */
/* apply the Macro2(Type1, Type2) to all C++ types */
/* apply the Macro2(CheckCode,Type) to all Checked Types */
/* ------------------------------------------------------------
* Generate the typemaps for all the primitive types with checkcode
* ------------------------------------------------------------ */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/primtypes.swg,341,%apply_checkctypes@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool (bool val, int ecode = 0) {
ecode = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) bool "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) const bool & ($*ltype temp, bool val, int ecode = 0) {
ecode = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const bool& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {bool}) bool {
bool val;
int res = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool *DIRECTOROUT(bool swig_val, int swig_res) {
swig_res = SWIG_AsVal_bool($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool {
bool swig_val;
int swig_res = SWIG_AsVal_bool($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {bool},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const bool& {
bool swig_val;
int swig_res = SWIG_AsVal_bool($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const bool & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {bool}) bool &DIRECTOROUT = bool
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=15,fragment="SWIG_" "AsVal" "_" {bool}) bool, const bool& {
int res = SWIG_AsVal_bool($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
bool val;
int ecode = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
bool val;
int ecode = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") bool *INPUT, bool &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=15,fragment="SWIG_" "AsVal" "_" {bool}) bool *INPUT, bool &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_bool($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool, const bool {
$result = SWIG_From_bool((bool)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {bool}) const bool& {
$result = SWIG_From_bool((bool)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool, const bool& {
$result = SWIG_From_bool((bool)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_bool((bool)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool *DIRECTORIN {
$input = SWIG_From_bool((bool)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool, const bool& {
$input = SWIG_From_bool((bool)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool {
SWIG_Python_Raise(SWIG_From_bool((bool)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
bool *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
bool &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool *OUTPUT, bool &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_bool((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) bool *INOUT = bool *INPUT;
%typemap(in) bool &INOUT = bool &INPUT;
%typemap(typecheck) bool *INOUT = bool *INPUT;
%typemap(typecheck) bool &INOUT = bool &INPUT;
%typemap(argout) bool *INOUT = bool *OUTPUT;
%typemap(argout) bool &INOUT = bool &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char (signed char val, int ecode = 0) {
ecode = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) signed char "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) const signed char & ($*ltype temp, signed char val, int ecode = 0) {
ecode = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const signed char& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {signed char}) signed char {
signed char val;
int res = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char *DIRECTOROUT(signed char swig_val, int swig_res) {
swig_res = SWIG_AsVal_signed_SS_char($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char {
signed char swig_val;
int swig_res = SWIG_AsVal_signed_SS_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const signed char& {
signed char swig_val;
int swig_res = SWIG_AsVal_signed_SS_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const signed char & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {signed char}) signed char &DIRECTOROUT = signed char
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=25,fragment="SWIG_" "AsVal" "_" {signed char}) signed char, const signed char& {
int res = SWIG_AsVal_signed_SS_char($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
signed char val;
int ecode = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
signed char val;
int ecode = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") signed char *INPUT, signed char &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=25,fragment="SWIG_" "AsVal" "_" {signed char}) signed char *INPUT, signed char &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_signed_SS_char($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char, const signed char {
$result = SWIG_From_signed_SS_char((signed char)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {signed char}) const signed char& {
$result = SWIG_From_signed_SS_char((signed char)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char, const signed char& {
$result = SWIG_From_signed_SS_char((signed char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_signed_SS_char((signed char)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char *DIRECTORIN {
$input = SWIG_From_signed_SS_char((signed char)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char, const signed char& {
$input = SWIG_From_signed_SS_char((signed char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char {
SWIG_Python_Raise(SWIG_From_signed_SS_char((signed char)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
signed char *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
signed char &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char *OUTPUT, signed char &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_signed_SS_char((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) signed char *INOUT = signed char *INPUT;
%typemap(in) signed char &INOUT = signed char &INPUT;
%typemap(typecheck) signed char *INOUT = signed char *INPUT;
%typemap(typecheck) signed char &INOUT = signed char &INPUT;
%typemap(argout) signed char *INOUT = signed char *OUTPUT;
%typemap(argout) signed char &INOUT = signed char &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char (unsigned char val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned char "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) const unsigned char & ($*ltype temp, unsigned char val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned char& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char {
unsigned char val;
int res = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char *DIRECTOROUT(unsigned char swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_char($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char {
unsigned char swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned char& {
unsigned char swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned char & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char &DIRECTOROUT = unsigned char
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=20,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char, const unsigned char& {
int res = SWIG_AsVal_unsigned_SS_char($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned char val;
int ecode = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned char val;
int ecode = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned char *INPUT, unsigned char &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=20,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char *INPUT, unsigned char &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_char($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char, const unsigned char {
$result = SWIG_From_unsigned_SS_char((unsigned char)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) const unsigned char& {
$result = SWIG_From_unsigned_SS_char((unsigned char)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char, const unsigned char& {
$result = SWIG_From_unsigned_SS_char((unsigned char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_char((unsigned char)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char *DIRECTORIN {
$input = SWIG_From_unsigned_SS_char((unsigned char)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char, const unsigned char& {
$input = SWIG_From_unsigned_SS_char((unsigned char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char {
SWIG_Python_Raise(SWIG_From_unsigned_SS_char((unsigned char)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned char *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned char &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char *OUTPUT, unsigned char &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_char((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned char *INOUT = unsigned char *INPUT;
%typemap(in) unsigned char &INOUT = unsigned char &INPUT;
%typemap(typecheck) unsigned char *INOUT = unsigned char *INPUT;
%typemap(typecheck) unsigned char &INOUT = unsigned char &INPUT;
%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT;
%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short (short val, int ecode = 0) {
ecode = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) short "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) const short & ($*ltype temp, short val, int ecode = 0) {
ecode = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const short& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {short}) short {
short val;
int res = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short *DIRECTOROUT(short swig_val, int swig_res) {
swig_res = SWIG_AsVal_short($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short {
short swig_val;
int swig_res = SWIG_AsVal_short($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {short},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const short& {
short swig_val;
int swig_res = SWIG_AsVal_short($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const short & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {short}) short &DIRECTOROUT = short
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=35,fragment="SWIG_" "AsVal" "_" {short}) short, const short& {
int res = SWIG_AsVal_short($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
short val;
int ecode = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
short val;
int ecode = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") short *INPUT, short &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=35,fragment="SWIG_" "AsVal" "_" {short}) short *INPUT, short &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_short($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {short}) short, const short {
$result = SWIG_From_short((short)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {short}) const short& {
$result = SWIG_From_short((short)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {short}) short, const short& {
$result = SWIG_From_short((short)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {short}) short {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_short((short)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {short}) short *DIRECTORIN {
$input = SWIG_From_short((short)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {short}) short, const short& {
$input = SWIG_From_short((short)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {short}) short {
SWIG_Python_Raise(SWIG_From_short((short)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
short *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
short &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {short}) short *OUTPUT, short &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_short((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) short *INOUT = short *INPUT;
%typemap(in) short &INOUT = short &INPUT;
%typemap(typecheck) short *INOUT = short *INPUT;
%typemap(typecheck) short &INOUT = short &INPUT;
%typemap(argout) short *INOUT = short *OUTPUT;
%typemap(argout) short &INOUT = short &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short (unsigned short val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned short "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) const unsigned short & ($*ltype temp, unsigned short val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned short& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short {
unsigned short val;
int res = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short *DIRECTOROUT(unsigned short swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_short($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short {
unsigned short swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_short($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned short& {
unsigned short swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_short($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned short & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short &DIRECTOROUT = unsigned short
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=30,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short, const unsigned short& {
int res = SWIG_AsVal_unsigned_SS_short($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned short val;
int ecode = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned short val;
int ecode = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned short *INPUT, unsigned short &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=30,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short *INPUT, unsigned short &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_short($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short, const unsigned short {
$result = SWIG_From_unsigned_SS_short((unsigned short)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) const unsigned short& {
$result = SWIG_From_unsigned_SS_short((unsigned short)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short, const unsigned short& {
$result = SWIG_From_unsigned_SS_short((unsigned short)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_short((unsigned short)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short *DIRECTORIN {
$input = SWIG_From_unsigned_SS_short((unsigned short)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short, const unsigned short& {
$input = SWIG_From_unsigned_SS_short((unsigned short)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short {
SWIG_Python_Raise(SWIG_From_unsigned_SS_short((unsigned short)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned short *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned short &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short *OUTPUT, unsigned short &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_short((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned short *INOUT = unsigned short *INPUT;
%typemap(in) unsigned short &INOUT = unsigned short &INPUT;
%typemap(typecheck) unsigned short *INOUT = unsigned short *INPUT;
%typemap(typecheck) unsigned short &INOUT = unsigned short &INPUT;
%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT;
%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int (int val, int ecode = 0) {
ecode = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) int "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) const int & ($*ltype temp, int val, int ecode = 0) {
ecode = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const int& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {int}) int {
int val;
int res = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int *DIRECTOROUT(int swig_val, int swig_res) {
swig_res = SWIG_AsVal_int($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int {
int swig_val;
int swig_res = SWIG_AsVal_int($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {int},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const int& {
int swig_val;
int swig_res = SWIG_AsVal_int($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const int & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {int}) int &DIRECTOROUT = int
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=45,fragment="SWIG_" "AsVal" "_" {int}) int, const int& {
int res = SWIG_AsVal_int($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
int val;
int ecode = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
int val;
int ecode = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") int *INPUT, int &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=45,fragment="SWIG_" "AsVal" "_" {int}) int *INPUT, int &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_int($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {int}) int, const int {
$result = SWIG_From_int((int)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {int}) const int& {
$result = SWIG_From_int((int)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {int}) int, const int& {
$result = SWIG_From_int((int)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {int}) int {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_int((int)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {int}) int *DIRECTORIN {
$input = SWIG_From_int((int)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {int}) int, const int& {
$input = SWIG_From_int((int)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {int}) int {
SWIG_Python_Raise(SWIG_From_int((int)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
int *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
int &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {int}) int *OUTPUT, int &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_int((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) int *INOUT = int *INPUT;
%typemap(in) int &INOUT = int &INPUT;
%typemap(typecheck) int *INOUT = int *INPUT;
%typemap(typecheck) int &INOUT = int &INPUT;
%typemap(argout) int *INOUT = int *OUTPUT;
%typemap(argout) int &INOUT = int &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int (unsigned int val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned int "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) const unsigned int & ($*ltype temp, unsigned int val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned int& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int {
unsigned int val;
int res = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int *DIRECTOROUT(unsigned int swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_int($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int {
unsigned int swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_int($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned int& {
unsigned int swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_int($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned int & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int &DIRECTOROUT = unsigned int
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=40,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int, const unsigned int& {
int res = SWIG_AsVal_unsigned_SS_int($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned int val;
int ecode = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned int val;
int ecode = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned int *INPUT, unsigned int &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=40,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int *INPUT, unsigned int &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_int($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int, const unsigned int {
$result = SWIG_From_unsigned_SS_int((unsigned int)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) const unsigned int& {
$result = SWIG_From_unsigned_SS_int((unsigned int)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int, const unsigned int& {
$result = SWIG_From_unsigned_SS_int((unsigned int)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_int((unsigned int)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int *DIRECTORIN {
$input = SWIG_From_unsigned_SS_int((unsigned int)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int, const unsigned int& {
$input = SWIG_From_unsigned_SS_int((unsigned int)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int {
SWIG_Python_Raise(SWIG_From_unsigned_SS_int((unsigned int)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned int *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned int &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int *OUTPUT, unsigned int &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_int((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned int *INOUT = unsigned int *INPUT;
%typemap(in) unsigned int &INOUT = unsigned int &INPUT;
%typemap(typecheck) unsigned int *INOUT = unsigned int *INPUT;
%typemap(typecheck) unsigned int &INOUT = unsigned int &INPUT;
%typemap(argout) unsigned int *INOUT = unsigned int *OUTPUT;
%typemap(argout) unsigned int &INOUT = unsigned int &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long (long val, int ecode = 0) {
ecode = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) long "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) const long & ($*ltype temp, long val, int ecode = 0) {
ecode = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const long& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {long}) long {
long val;
int res = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long *DIRECTOROUT(long swig_val, int swig_res) {
swig_res = SWIG_AsVal_long($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long {
long swig_val;
int swig_res = SWIG_AsVal_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {long},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const long& {
long swig_val;
int swig_res = SWIG_AsVal_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const long & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {long}) long &DIRECTOROUT = long
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=55,fragment="SWIG_" "AsVal" "_" {long}) long, const long& {
int res = SWIG_AsVal_long($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
long val;
int ecode = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
long val;
int ecode = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") long *INPUT, long &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=55,fragment="SWIG_" "AsVal" "_" {long}) long *INPUT, long &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_long($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {long}) long, const long {
$result = SWIG_From_long((long)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {long}) const long& {
$result = SWIG_From_long((long)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {long}) long, const long& {
$result = SWIG_From_long((long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {long}) long {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_long((long)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {long}) long *DIRECTORIN {
$input = SWIG_From_long((long)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {long}) long, const long& {
$input = SWIG_From_long((long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {long}) long {
SWIG_Python_Raise(SWIG_From_long((long)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
long *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
long &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {long}) long *OUTPUT, long &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_long((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) long *INOUT = long *INPUT;
%typemap(in) long &INOUT = long &INPUT;
%typemap(typecheck) long *INOUT = long *INPUT;
%typemap(typecheck) long &INOUT = long &INPUT;
%typemap(argout) long *INOUT = long *OUTPUT;
%typemap(argout) long &INOUT = long &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long (unsigned long val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned long "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) const unsigned long & ($*ltype temp, unsigned long val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned long& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long {
unsigned long val;
int res = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long *DIRECTOROUT(unsigned long swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_long($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long {
unsigned long swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned long& {
unsigned long swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned long & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long &DIRECTOROUT = unsigned long
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=50,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long, const unsigned long& {
int res = SWIG_AsVal_unsigned_SS_long($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned long val;
int ecode = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned long val;
int ecode = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned long *INPUT, unsigned long &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=50,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long *INPUT, unsigned long &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_long($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long, const unsigned long {
$result = SWIG_From_unsigned_SS_long((unsigned long)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) const unsigned long& {
$result = SWIG_From_unsigned_SS_long((unsigned long)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long, const unsigned long& {
$result = SWIG_From_unsigned_SS_long((unsigned long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_long((unsigned long)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long *DIRECTORIN {
$input = SWIG_From_unsigned_SS_long((unsigned long)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long, const unsigned long& {
$input = SWIG_From_unsigned_SS_long((unsigned long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long {
SWIG_Python_Raise(SWIG_From_unsigned_SS_long((unsigned long)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned long *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned long &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long *OUTPUT, unsigned long &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_long((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned long *INOUT = unsigned long *INPUT;
%typemap(in) unsigned long &INOUT = unsigned long &INPUT;
%typemap(typecheck) unsigned long *INOUT = unsigned long *INPUT;
%typemap(typecheck) unsigned long &INOUT = unsigned long &INPUT;
%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT;
%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long (long long val, int ecode = 0) {
ecode = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) long long "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) const long long & ($*ltype temp, long long val, int ecode = 0) {
ecode = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const long long& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {long long}) long long {
long long val;
int res = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long *DIRECTOROUT(long long swig_val, int swig_res) {
swig_res = SWIG_AsVal_long_SS_long($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long {
long long swig_val;
int swig_res = SWIG_AsVal_long_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {long long},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const long long& {
long long swig_val;
int swig_res = SWIG_AsVal_long_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const long long & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {long long}) long long &DIRECTOROUT = long long
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=65,fragment="SWIG_" "AsVal" "_" {long long}) long long, const long long& {
int res = SWIG_AsVal_long_SS_long($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
long long val;
int ecode = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
long long val;
int ecode = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") long long *INPUT, long long &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=65,fragment="SWIG_" "AsVal" "_" {long long}) long long *INPUT, long long &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_long_SS_long($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long, const long long {
$result = SWIG_From_long_SS_long((long long)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {long long}) const long long& {
$result = SWIG_From_long_SS_long((long long)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long, const long long& {
$result = SWIG_From_long_SS_long((long long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_long_SS_long((long long)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long *DIRECTORIN {
$input = SWIG_From_long_SS_long((long long)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long, const long long& {
$input = SWIG_From_long_SS_long((long long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long {
SWIG_Python_Raise(SWIG_From_long_SS_long((long long)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
long long *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
long long &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long *OUTPUT, long long &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_long_SS_long((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) long long *INOUT = long long *INPUT;
%typemap(in) long long &INOUT = long long &INPUT;
%typemap(typecheck) long long *INOUT = long long *INPUT;
%typemap(typecheck) long long &INOUT = long long &INPUT;
%typemap(argout) long long *INOUT = long long *OUTPUT;
%typemap(argout) long long &INOUT = long long &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long (unsigned long long val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned long long "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) const unsigned long long & ($*ltype temp, unsigned long long val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned long long& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long {
unsigned long long val;
int res = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long *DIRECTOROUT(unsigned long long swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_long_SS_long($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long {
unsigned long long swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_long_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned long long& {
unsigned long long swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_long_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned long long & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long &DIRECTOROUT = unsigned long long
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=60,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long, const unsigned long long& {
int res = SWIG_AsVal_unsigned_SS_long_SS_long($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned long long val;
int ecode = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned long long val;
int ecode = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned long long *INPUT, unsigned long long &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=60,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long *INPUT, unsigned long long &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_long_SS_long($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long, const unsigned long long {
$result = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) const unsigned long long& {
$result = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long, const unsigned long long& {
$result = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long *DIRECTORIN {
$input = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long, const unsigned long long& {
$input = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long {
SWIG_Python_Raise(SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned long long *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned long long &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long *OUTPUT, unsigned long long &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_long_SS_long((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT;
%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT;
%typemap(typecheck) unsigned long long *INOUT = unsigned long long *INPUT;
%typemap(typecheck) unsigned long long &INOUT = unsigned long long &INPUT;
%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT;
%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float (float val, int ecode = 0) {
ecode = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) float "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) const float & ($*ltype temp, float val, int ecode = 0) {
ecode = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const float& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {float}) float {
float val;
int res = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float *DIRECTOROUT(float swig_val, int swig_res) {
swig_res = SWIG_AsVal_float($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float {
float swig_val;
int swig_res = SWIG_AsVal_float($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {float},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const float& {
float swig_val;
int swig_res = SWIG_AsVal_float($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const float & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {float}) float &DIRECTOROUT = float
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=80,fragment="SWIG_" "AsVal" "_" {float}) float, const float& {
int res = SWIG_AsVal_float($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
float val;
int ecode = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
float val;
int ecode = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") float *INPUT, float &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=80,fragment="SWIG_" "AsVal" "_" {float}) float *INPUT, float &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_float($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {float}) float, const float {
$result = SWIG_From_float((float)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {float}) const float& {
$result = SWIG_From_float((float)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {float}) float, const float& {
$result = SWIG_From_float((float)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {float}) float {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_float((float)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {float}) float *DIRECTORIN {
$input = SWIG_From_float((float)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {float}) float, const float& {
$input = SWIG_From_float((float)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {float}) float {
SWIG_Python_Raise(SWIG_From_float((float)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
float *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
float &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {float}) float *OUTPUT, float &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_float((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) float *INOUT = float *INPUT;
%typemap(in) float &INOUT = float &INPUT;
%typemap(typecheck) float *INOUT = float *INPUT;
%typemap(typecheck) float &INOUT = float &INPUT;
%typemap(argout) float *INOUT = float *OUTPUT;
%typemap(argout) float &INOUT = float &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double (double val, int ecode = 0) {
ecode = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) double "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) const double & ($*ltype temp, double val, int ecode = 0) {
ecode = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const double& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {double}) double {
double val;
int res = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double *DIRECTOROUT(double swig_val, int swig_res) {
swig_res = SWIG_AsVal_double($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double {
double swig_val;
int swig_res = SWIG_AsVal_double($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {double},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const double& {
double swig_val;
int swig_res = SWIG_AsVal_double($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const double & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {double}) double &DIRECTOROUT = double
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=90,fragment="SWIG_" "AsVal" "_" {double}) double, const double& {
int res = SWIG_AsVal_double($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
double val;
int ecode = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
double val;
int ecode = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") double *INPUT, double &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=90,fragment="SWIG_" "AsVal" "_" {double}) double *INPUT, double &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_double($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {double}) double, const double {
$result = SWIG_From_double((double)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {double}) const double& {
$result = SWIG_From_double((double)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {double}) double, const double& {
$result = SWIG_From_double((double)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {double}) double {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_double((double)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {double}) double *DIRECTORIN {
$input = SWIG_From_double((double)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {double}) double, const double& {
$input = SWIG_From_double((double)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {double}) double {
SWIG_Python_Raise(SWIG_From_double((double)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
double *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
double &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {double}) double *OUTPUT, double &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_double((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) double *INOUT = double *INPUT;
%typemap(in) double &INOUT = double &INPUT;
%typemap(typecheck) double *INOUT = double *INPUT;
%typemap(typecheck) double &INOUT = double &INPUT;
%typemap(argout) double *INOUT = double *OUTPUT;
%typemap(argout) double &INOUT = double &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char (char val, int ecode = 0) {
ecode = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) char "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) const char & ($*ltype temp, char val, int ecode = 0) {
ecode = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const char& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {char}) char {
char val;
int res = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char *DIRECTOROUT(char swig_val, int swig_res) {
swig_res = SWIG_AsVal_char($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char {
char swig_val;
int swig_res = SWIG_AsVal_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {char},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const char& {
char swig_val;
int swig_res = SWIG_AsVal_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const char & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {char}) char &DIRECTOROUT = char
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=130,fragment="SWIG_" "AsVal" "_" {char}) char, const char& {
int res = SWIG_AsVal_char($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
char val;
int ecode = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
char val;
int ecode = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") char *INPUT, char &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=130,fragment="SWIG_" "AsVal" "_" {char}) char *INPUT, char &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_char($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {char}) char, const char {
$result = SWIG_From_char((char)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {char}) const char& {
$result = SWIG_From_char((char)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {char}) char, const char& {
$result = SWIG_From_char((char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {char}) char {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_char((char)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {char}) char *DIRECTORIN {
$input = SWIG_From_char((char)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {char}) char, const char& {
$input = SWIG_From_char((char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {char}) char {
SWIG_Python_Raise(SWIG_From_char((char)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
char *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
char &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {char}) char *OUTPUT, char &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_char((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) char *INOUT = char *INPUT;
%typemap(in) char &INOUT = char &INPUT;
%typemap(typecheck) char *INOUT = char *INPUT;
%typemap(typecheck) char &INOUT = char &INPUT;
%typemap(argout) char *INOUT = char *OUTPUT;
%typemap(argout) char &INOUT = char &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t (wchar_t val, int ecode = 0) {
ecode = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) wchar_t "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) const wchar_t & ($*ltype temp, wchar_t val, int ecode = 0) {
ecode = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const wchar_t& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t {
wchar_t val;
int res = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t *DIRECTOROUT(wchar_t swig_val, int swig_res) {
swig_res = SWIG_AsVal_wchar_t($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t {
wchar_t swig_val;
int swig_res = SWIG_AsVal_wchar_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const wchar_t& {
wchar_t swig_val;
int swig_res = SWIG_AsVal_wchar_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const wchar_t & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t &DIRECTOROUT = wchar_t
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=110,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t, const wchar_t& {
int res = SWIG_AsVal_wchar_t($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
wchar_t val;
int ecode = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
wchar_t val;
int ecode = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") wchar_t *INPUT, wchar_t &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=110,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t *INPUT, wchar_t &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_wchar_t($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t, const wchar_t {
$result = SWIG_From_wchar_t((wchar_t)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) const wchar_t& {
$result = SWIG_From_wchar_t((wchar_t)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t, const wchar_t& {
$result = SWIG_From_wchar_t((wchar_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_wchar_t((wchar_t)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t *DIRECTORIN {
$input = SWIG_From_wchar_t((wchar_t)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t, const wchar_t& {
$input = SWIG_From_wchar_t((wchar_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t {
SWIG_Python_Raise(SWIG_From_wchar_t((wchar_t)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
wchar_t *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
wchar_t &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t *OUTPUT, wchar_t &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_wchar_t((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) wchar_t *INOUT = wchar_t *INPUT;
%typemap(in) wchar_t &INOUT = wchar_t &INPUT;
%typemap(typecheck) wchar_t *INOUT = wchar_t *INPUT;
%typemap(typecheck) wchar_t &INOUT = wchar_t &INPUT;
%typemap(argout) wchar_t *INOUT = wchar_t *OUTPUT;
%typemap(argout) wchar_t &INOUT = wchar_t &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t (size_t val, int ecode = 0) {
ecode = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) size_t "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) const size_t & ($*ltype temp, size_t val, int ecode = 0) {
ecode = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const size_t& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {size_t}) size_t {
size_t val;
int res = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t *DIRECTOROUT(size_t swig_val, int swig_res) {
swig_res = SWIG_AsVal_size_t($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t {
size_t swig_val;
int swig_res = SWIG_AsVal_size_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const size_t& {
size_t swig_val;
int swig_res = SWIG_AsVal_size_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const size_t & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {size_t}) size_t &DIRECTOROUT = size_t
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=47,fragment="SWIG_" "AsVal" "_" {size_t}) size_t, const size_t& {
int res = SWIG_AsVal_size_t($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
size_t val;
int ecode = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
size_t val;
int ecode = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") size_t *INPUT, size_t &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=47,fragment="SWIG_" "AsVal" "_" {size_t}) size_t *INPUT, size_t &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_size_t($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t, const size_t {
$result = SWIG_From_size_t((size_t)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {size_t}) const size_t& {
$result = SWIG_From_size_t((size_t)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t, const size_t& {
$result = SWIG_From_size_t((size_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_size_t((size_t)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t *DIRECTORIN {
$input = SWIG_From_size_t((size_t)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t, const size_t& {
$input = SWIG_From_size_t((size_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t {
SWIG_Python_Raise(SWIG_From_size_t((size_t)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
size_t *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
size_t &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t *OUTPUT, size_t &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_size_t((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) size_t *INOUT = size_t *INPUT;
%typemap(in) size_t &INOUT = size_t &INPUT;
%typemap(typecheck) size_t *INOUT = size_t *INPUT;
%typemap(typecheck) size_t &INOUT = size_t &INPUT;
%typemap(argout) size_t *INOUT = size_t *OUTPUT;
%typemap(argout) size_t &INOUT = size_t &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t (ptrdiff_t val, int ecode = 0) {
ecode = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) ptrdiff_t "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) const ptrdiff_t & ($*ltype temp, ptrdiff_t val, int ecode = 0) {
ecode = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const ptrdiff_t& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t {
ptrdiff_t val;
int res = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t *DIRECTOROUT(ptrdiff_t swig_val, int swig_res) {
swig_res = SWIG_AsVal_ptrdiff_t($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t {
ptrdiff_t swig_val;
int swig_res = SWIG_AsVal_ptrdiff_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const ptrdiff_t& {
ptrdiff_t swig_val;
int swig_res = SWIG_AsVal_ptrdiff_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const ptrdiff_t & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t &DIRECTOROUT = ptrdiff_t
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=48,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t, const ptrdiff_t& {
int res = SWIG_AsVal_ptrdiff_t($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
ptrdiff_t val;
int ecode = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
ptrdiff_t val;
int ecode = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") ptrdiff_t *INPUT, ptrdiff_t &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=48,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t *INPUT, ptrdiff_t &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_ptrdiff_t($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t, const ptrdiff_t {
$result = SWIG_From_ptrdiff_t((ptrdiff_t)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) const ptrdiff_t& {
$result = SWIG_From_ptrdiff_t((ptrdiff_t)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t, const ptrdiff_t& {
$result = SWIG_From_ptrdiff_t((ptrdiff_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_ptrdiff_t((ptrdiff_t)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t *DIRECTORIN {
$input = SWIG_From_ptrdiff_t((ptrdiff_t)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t, const ptrdiff_t& {
$input = SWIG_From_ptrdiff_t((ptrdiff_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t {
SWIG_Python_Raise(SWIG_From_ptrdiff_t((ptrdiff_t)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
ptrdiff_t *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
ptrdiff_t &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t *OUTPUT, ptrdiff_t &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_ptrdiff_t((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) ptrdiff_t *INOUT = ptrdiff_t *INPUT;
%typemap(in) ptrdiff_t &INOUT = ptrdiff_t &INPUT;
%typemap(typecheck) ptrdiff_t *INOUT = ptrdiff_t *INPUT;
%typemap(typecheck) ptrdiff_t &INOUT = ptrdiff_t &INPUT;
%typemap(argout) ptrdiff_t *INOUT = ptrdiff_t *OUTPUT;
%typemap(argout) ptrdiff_t &INOUT = ptrdiff_t &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG@*/;
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/string.swg" %beginfile
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,222,%ensure_fragment@*/
%fragment("SWIG_AsCharPtrAndSize","header") {
#error "SWIG language implementation must provide the SWIG_AsCharPtrAndSize fragment"
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,222,%ensure_fragment@*/
%fragment("SWIG_FromCharPtrAndSize","header") {
#error "SWIG language implementation must provide the SWIG_FromCharPtrAndSize fragment"
}
/*@SWIG@*/
%types(char *);
%fragment("SWIG_pchar_descriptor","header") {
SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
static int init = 0;
static swig_type_info* info = 0;
if (!init) {
info = SWIG_TypeQuery("_p_char");
init = 1;
}
return info;
}
}
%fragment("SWIG_strnlen","header",fragment="SWIG_FromCharPtrAndSize") {
SWIGINTERN size_t
SWIG_strnlen(const char* s, size_t maxlen)
{
const char *p;
for (p = s; maxlen-- && *p; p++)
;
return p - s;
}
}
%includefile "/usr/share/swig/4.0.0/typemaps/strings.swg" %beginfile
//
// Use the macro SWIG_PRESERVE_CARRAY_SIZE if you prefer to preserve
// the size of char arrays, ie
// ------------------------------------------
// C Side => Language Side
// ------------------------------------------
// char name[5] = "hola" => 'hola\0'
//
// the default behaviour is
//
// char name[5] = "hola" => 'hola'
//
//
//#define SWIG_PRESERVE_CARRAY_SIZE
/* ------------------------------------------------------------
* String typemaps for type Char (char or wchar_t)
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* --- String fragment methods ---
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* String typemaps and fragments, with default allocators
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* String typemaps and fragments, with custom allocators
* ------------------------------------------------------------ */
%endoffile
/*@SWIG:/usr/share/swig/4.0.0/typemaps/strings.swg,611,%typemaps_string@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/strings.swg,503,%_typemap2_string@*/
%fragment("SWIG_From""Char""Ptr","header",fragment="SWIG_FromCharPtrAndSize") {
SWIGINTERNINLINE PyObject *
SWIG_FromCharPtr(const char *cptr)
{
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
}
%fragment("SWIG_From""Char""Array","header",fragment="SWIG_FromCharPtrAndSize") {
SWIGINTERNINLINE PyObject *
SWIG_FromCharArray(const char *cptr, size_t size)
{
return SWIG_FromCharPtrAndSize(cptr, size);
}
}
%fragment("SWIG_As""Char" "Ptr","header",fragment="SWIG_AsCharPtrAndSize") {
}
%fragment("SWIG_As""Char" "Array","header",fragment="SWIG_AsCharPtrAndSize") {
SWIGINTERN int
SWIG_AsCharArray(PyObject * obj, char *val, size_t size)
{
char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
if (SWIG_IsOK(res)) {
/* special case of single char conversion when we don't need space for NUL */
if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize;
if (csize <= size) {
if (val) {
if (csize) memcpy(val, cptr, csize*sizeof(char));
if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
}
if (alloc == SWIG_NEWOBJ) {
free((char*)cptr);
res = SWIG_DelNewMask(res);
}
return res;
}
if (alloc == SWIG_NEWOBJ) free((char*)cptr);
}
return SWIG_TypeError;
}
}
/* char */
%fragment("SWIG_" "From" "_" {char},"header",fragment="SWIG_FromCharPtrAndSize") {
SWIGINTERNINLINE PyObject *
SWIG_From_char (char c)
{
return SWIG_FromCharPtrAndSize(&c,1);
}
}
%fragment("SWIG_" "AsVal" "_" {char},"header",
fragment="SWIG_As""Char""Array",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_char (PyObject * obj, char *val)
{
int res = SWIG_AsCharArray(obj, val, 1);
if (!SWIG_IsOK(res)) {
long v;
res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
if (SWIG_IsOK(res)) {
if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
if (val) *val = (char)(v);
} else {
res = SWIG_OverflowError;
}
}
}
return res;
}
}
/*@SWIG:/usr/share/swig/4.0.0/typemaps/strings.swg,20,%_typemap_string@*/
/* in */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtr")
char * (int res, char *buf = 0, int alloc = 0),
const char * (int res, char *buf = 0, int alloc = 0) {
res = SWIG_AsCharPtrAndSize($input, &buf, NULL, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($1_ltype)(buf);
}
%typemap(freearg,noblock=1,match="in") char *, const char * {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
%typemap(in,noblock=1,fragment="SWIG_AsCharPtr") char const*& (int res, char *buf = 0, int alloc = 0) {
res = SWIG_AsCharPtrAndSize($input, &buf, NULL, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = &buf;
}
%typemap(freearg, noblock=1,match="in") char const*& {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* out */
%typemap(out,noblock=1,fragment="SWIG_FromCharPtr") char *, const char * {
$result = SWIG_FromCharPtr((const char *)$1);
}
%typemap(out,noblock=1,fragment="SWIG_FromCharPtr") char const*& {
$result = SWIG_FromCharPtr(*$1);
}
%typemap(newfree,noblock=1) char * {
free((char*)$1);
}
/* varin */
%typemap(varin,fragment="SWIG_AsCharPtrAndSize") char * {
char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ;
int res = SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if ($1) free((char*)$1);
if (alloc == SWIG_NEWOBJ) {
$1 = cptr;
} else {
$1 = csize ? ($1_type)(char *)memcpy(malloc((csize)*sizeof(char)), cptr, sizeof(char)*(csize)) : 0;
}
}
%typemap(varin,fragment="SWIG_AsCharPtrAndSize",warning= "451:Setting a const char * variable may leak memory." ) const char * {
char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ;
int res = SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if (alloc == SWIG_NEWOBJ) {
$1 = cptr;
} else {
$1 = csize ? ($1_type)(char *)memcpy(malloc((csize)*sizeof(char)), cptr, sizeof(char)*(csize)) : 0;
}
}
/* varout */
%typemap(varout,noblock=1,fragment="SWIG_FromCharPtr") char *, const char * {
$result = SWIG_FromCharPtr($1);
}
/* memberin */
%typemap(memberin,noblock=1) char * {
if ($1) free((char*)$1);
if ($input) {
size_t size = strlen((const char *)($input)) + 1;
$1 = ($1_type)(char *)memcpy(malloc((size)*sizeof(char)), (const char *)($input), sizeof(char)*(size));
} else {
$1 = 0;
}
}
%typemap(memberin,noblock=1,warning= "451:Setting a const char * variable may leak memory." ) const char * {
if ($input) {
size_t size = strlen((const char *)((const char *)($input))) + 1;
$1 = ($1_type)(char *)memcpy(malloc((size)*sizeof(char)), $input, sizeof(char)*(size));
} else {
$1 = 0;
}
}
/* globalin */
%typemap(globalin,noblock=1) char * {
if ($1) free((char*)$1);
if ($input) {
size_t size = strlen((const char *)((const char *)($input))) + 1;
$1 = ($1_type)(char *)memcpy(malloc((size)*sizeof(char)), $input, sizeof(char)*(size));
} else {
$1 = 0;
}
}
%typemap(globalin,noblock=1,warning= "451:Setting a const char * variable may leak memory." ) const char * {
if ($input) {
size_t size = strlen($input) + 1;
$1 = ($1_type)(char *)memcpy(malloc((size)*sizeof(char)), $input, sizeof(char)*(size));
} else {
$1 = 0;
}
}
/* constant */
%typemap(constcode,noblock=1,fragment="SWIG_FromCharPtr")
char *, char const*, char * const, char const* const {
SWIG_Python_SetConstant(d, "$symname",SWIG_FromCharPtr($value));
}
/* directorin */
%typemap(directorin,noblock=1,fragment="SWIG_FromCharPtr")
char *, char const*, char *const, char const *const,
char const *&, char *const &, char const *const & {
$input = SWIG_FromCharPtr((const char *)$1);
}
/* directorout */
%typemap(directorout,noblock=1,fragment="SWIG_AsCharPtr",warning= "473:Returning a pointer or reference in a director method is not recommended." ) char * (int res, char *buf = 0, int alloc = SWIG_NEWOBJ) {
res = SWIG_AsCharPtrAndSize($input, &buf, NULL, &alloc);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
if (alloc == SWIG_NEWOBJ) {
swig_acquire_ownership_array(buf);
}
$result = ($1_ltype)(buf);
}
%typemap(directorfree,noblock=1) char *
{
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,noblock=1,fragment="SWIG_AsCharPtr",warning= "473:Returning a pointer or reference in a director method is not recommended." ) char *const& (int res, char *buf = 0, int alloc = SWIG_NEWOBJ), char const*const& (int res, char *buf = 0, int alloc = SWIG_NEWOBJ) {
res = SWIG_AsCharPtrAndSize($input, &buf, NULL, &alloc);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
static $*1_ltype tmp = buf;
$result = &tmp;
if (alloc == SWIG_NEWOBJ) {
swig_acquire_ownership_array(buf);
}
}
%typemap(directorfree,noblock=1)
char * const&, char const* const& {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr(*$input));
}
}
/* typecheck */
%typemap(typecheck,noblock=1,precedence=140,
fragment="SWIG_AsCharPtr") char *, const char *, char const*& {
int res = SWIG_AsCharPtrAndSize($input, 0, NULL, 0);
$1 = SWIG_CheckState(res);
}
/* throws */
%typemap(throws,noblock=1,fragment="SWIG_FromCharPtr") char * {
SWIG_Python_Raise(SWIG_FromCharPtr($1), "$type", 0); SWIG_fail;
}
/* ------------------------------------------------------------
* Unknown size const Character array char[ANY] handling
* ------------------------------------------------------------ */
%apply char * { char [] };
%apply const char * { const char [] };
%typemap(varin,noblock=1,warning="462:Unable to set variable of type char []") char []
{
SWIG_exception_fail(SWIG_ArgError(SWIG_AttributeError), "in variable '""read-only $name""' of type '""$type""'");
}
/* ------------------------------------------------------------
* Fixed size Character array char[ANY] handling
* ------------------------------------------------------------ */
/* memberin and globalin typemaps */
%typemap(memberin,noblock=1) char [ANY]
{
if ($input) memcpy($1,$input,$1_dim0*sizeof(char));
else memset($1,0,$1_dim0*sizeof(char));
}
%typemap(globalin,noblock=1) char [ANY]
{
if ($input) memcpy($1,$input,$1_dim0*sizeof(char));
else memset($1,0,$1_dim0*sizeof(char));
}
/* in */
%typemap(in,noblock=1,fragment="SWIG_AsCharArray")
char [ANY] (char temp[$1_dim0], int res),
const char [ANY](char temp[$1_dim0], int res)
{
res = SWIG_AsCharArray($input, temp, $1_dim0);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($1_ltype)(temp);
}
%typemap(freearg) char [ANY], const char [ANY] "";
%typemap(in,noblock=1,fragment="SWIG_AsCharArray") const char (&)[ANY] (char temp[$1_dim0], int res)
{
res = SWIG_AsCharArray($input, temp, $1_dim0);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = &temp;
}
%typemap(freearg) const char (&)[ANY] "";
%typemap(out,fragment="SWIG_FromCharPtrAndSize",fragment="SWIG_strnlen")
char [ANY], const char[ANY]
{
size_t size = SWIG_strnlen($1, $1_dim0);
$result = SWIG_FromCharPtrAndSize($1, size);
}
/* varin */
%typemap(varin,fragment="SWIG_AsCharArray") char [ANY]
{
int res = SWIG_AsCharArray($input, $1, $1_dim0);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
}
/* varout */
%typemap(varout,fragment="SWIG_strnlen")
char [ANY], const char [ANY] {
size_t size = SWIG_strnlen($1, $1_dim0);
$result = SWIG_FromCharPtrAndSize($1, size);
}
/* constant */
%typemap(constcode,fragment="SWIG_strnlen")
char [ANY], const char [ANY]
{
size_t size = SWIG_strnlen($1, $1_dim0);
SWIG_Python_SetConstant(d, "$symname",SWIG_FromCharPtrAndSize($value,size));
}
/* directorin */
%typemap(directorin,fragment="SWIG_strnlen")
char [ANY], const char [ANY]
{
size_t size = SWIG_strnlen($1, $1_dim0);
$input = SWIG_FromCharPtrAndSize($1, size);
}
/* directorout */
%typemap(directorout,noblock=1,fragment="SWIG_AsCharArray")
char [ANY] (char temp[$result_dim0]),
const char [ANY] (char temp[$result_dim0], int res)
{
res = SWIG_AsCharArray($input, temp, $result_dim0);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
$result = temp;
}
/* typecheck */
%typemap(typecheck,noblock=1,precedence=140,
fragment="SWIG_AsCharArray")
char [ANY], const char[ANY] {
int res = SWIG_AsCharArray($input, (char *)0, $1_dim0);
$1 = SWIG_CheckState(res);
}
/* throws */
%typemap(throws,fragment="SWIG_strnlen")
char [ANY], const char[ANY]
{
size_t size = SWIG_strnlen($1, $1_dim0);
SWIG_Python_Raise(SWIG_FromCharPtrAndSize($1, size), "$type", 0); SWIG_fail;
}
/* -------------------------------------------------------------------
* --- Really fix size char arrays, including '\0'chars at the end ---
* ------------------------------------------------------------------- */
%typemap(varout,noblock=1,fragment="SWIG_FromCharPtrAndSize")
char FIXSIZE[ANY], const char FIXSIZE[ANY]
{
$result = SWIG_FromCharPtrAndSize($1, $1_dim0);
}
%typemap(out,noblock=1,fragment="SWIG_FromCharPtrAndSize")
char FIXSIZE[ANY], const char FIXSIZE[ANY]
{
$result = SWIG_FromCharPtrAndSize($1, $1_dim0);
}
%typemap(directorin,noblock=1,fragment="SWIG_FromCharPtrAndSize")
char FIXSIZE[ANY], const char FIXSIZE[ANY]
{
$input = SWIG_FromCharPtrAndSize($1, $1_dim0);
}
%typemap(throws,noblock=1,fragment="SWIG_FromCharPtrAndSize")
char FIXSIZE[ANY], const char FIXSIZE[ANY] {
SWIG_Python_Raise(SWIG_FromCharPtrAndSize($1, $1_dim0), "$type", 0); SWIG_fail;
}
/* ------------------------------------------------------------
* --- String & length ---
* ------------------------------------------------------------ */
/* Here len doesn't include the '0' terminator */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtrAndSize")
(char *STRING, size_t LENGTH) (int res, char *buf = 0, size_t size = 0, int alloc = 0),
(const char *STRING, size_t LENGTH) (int res, char *buf = 0, size_t size = 0, int alloc = 0)
{
res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($1_ltype)(buf);
$2 = ($2_ltype)(size - 1);
}
%typemap(freearg,noblock=1,match="in") (char *STRING, size_t LENGTH) {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* old 'int' form */
%typemap(in) (char *STRING, int LENGTH) = (char *STRING, size_t LENGTH);
%typemap(freearg) (char *STRING, int LENGTH) = (char *STRING, size_t LENGTH);
/* Here size includes the '0' terminator */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtrAndSize")
(char *STRING, size_t SIZE) (int res, char *buf = 0, size_t size = 0, int alloc = 0),
(const char *STRING, size_t SIZE) (int res, char *buf = 0, size_t size = 0, int alloc = 0)
{
res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($1_ltype)(buf);
$2 = ($2_ltype)(size);
}
%typemap(freearg,noblock=1,match="in") (char *STRING, size_t SIZE) {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* old 'int' form */
%typemap(in) (char *STRING, int SIZE) = (char *STRING, size_t SIZE);
%typemap(freearg) (char *STRING, int SIZE) = (char *STRING, size_t SIZE);
/* reverse order versions */
/* Here len doesn't include the '0' terminator */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtrAndSize")
(size_t LENGTH, char *STRING) (int res, char *buf = 0, size_t size = 0, int alloc = 0),
(size_t LENGTH, const char *STRING) (int res, char *buf = 0, size_t size = 0, int alloc = 0)
{
res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$2 = ($2_ltype)(buf) ;
$1 = ($1_ltype)(size - 1) ;
}
%typemap(freearg, noblock=1, match="in") (size_t LENGTH, char *STRING) {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* old 'int' form */
%typemap(in) (int LENGTH, char *STRING) = (size_t LENGTH, char *STRING);
%typemap(freearg) (int LENGTH, char *STRING) = (size_t LENGTH, char *STRING);
/* Here size includes the '0' terminator */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtrAndSize")
(size_t SIZE, char *STRING) (int res, char *buf = 0, size_t size = 0, int alloc = 0),
(size_t SIZE, const char *STRING) (int res, char *buf = 0, size_t size = 0, int alloc = 0)
{
res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$2 = ($2_ltype)(buf) ;
$1 = ($1_ltype)(size) ;
}
%typemap(freearg, noblock=1, match="in") (size_t SIZE, char *STRING) {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* old 'int' form */
%typemap(in) (int SIZE, char *STRING) = (size_t SIZE, char *STRING);
%typemap(freearg) (int SIZE, char *STRING) = (size_t SIZE, char *STRING);
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG@*/
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/misctypes.swg" %beginfile
/* ------------------------------------------------------------
* --- ANSI/Posix C/C++ types ---
* ------------------------------------------------------------ */
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/enumint.swg" %beginfile
/* ------------------------------------------------------------
* Enums mapped as integer values
* ------------------------------------------------------------ */
%apply int { enum SWIGTYPE };
%apply const int& { const enum SWIGTYPE & };
%apply const int& { const enum SWIGTYPE && };
%typemap(in,fragment="SWIG_" "AsVal" "_" {int},noblock=1) const enum SWIGTYPE & (int val, int ecode, $basetype temp) {
ecode = SWIG_AsVal_int ($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
} else {
temp = ($basetype)(val);
$1 = &temp;
}
}
%typemap(in,fragment="SWIG_" "AsVal" "_" {int},noblock=1) const enum SWIGTYPE && (int val, int ecode, $basetype temp) {
ecode = SWIG_AsVal_int ($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
} else {
temp = ($basetype)(val);
$1 = &temp;
}
}
%typemap(varin,fragment="SWIG_" "AsVal" "_" {int},noblock=1) enum SWIGTYPE {
if (sizeof(int) != sizeof($1)) {
SWIG_exception_fail(SWIG_ArgError(SWIG_AttributeError), "in variable '""arch, read-only $name""' of type '""$type""'");
} else {
int ecode = SWIG_AsVal_int ($input, (int*)(&$1));
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in variable '""$name""' of type '""$type""'");
}
}
}
%endoffile
%endoffile
/* ------------------------------------------------------------
* 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(($*ltype *)memcpy(($*ltype *)calloc(1,sizeof($*ltype)),&*$1,sizeof($*ltype)), $descriptor, SWIG_POINTER_OWN | 0 );
}
%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);
}
}
}
%endoffile
/* ------------------------------------------------------------
* Overloaded operator support
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyopers.swg" %beginfile
/* ------------------------------------------------------------
* 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:<slot>"),
where <slot> 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
* ------------------------------------------------------------ */
%endoffile
/* ------------------------------------------------------------
* Warnings for Python keywords
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pythonkw.swg" %beginfile
/*
Warnings for Python keywords, built-in names and bad names.
*/
/*
Warnings for Python keywords
https://docs.python.org/2/reference/lexical_analysis.html#keywords
*/
%namewarn("314"":""'" "and" "' is a python keyword, renaming to '_" "and" "'",rename="_%s") "and";
%namewarn("314"":""'" "as" "' is a python keyword, renaming to '_" "as" "'",rename="_%s") "as";
%namewarn("314"":""'" "assert" "' is a python keyword, renaming to '_" "assert" "'",rename="_%s") "assert";
%namewarn("314"":""'" "async" "' is a python keyword, renaming to '_" "async" "'",rename="_%s") "async";
%namewarn("314"":""'" "await" "' is a python keyword, renaming to '_" "await" "'",rename="_%s") "await";
%namewarn("314"":""'" "break" "' is a python keyword, renaming to '_" "break" "'",rename="_%s") "break";
%namewarn("314"":""'" "class" "' is a python keyword, renaming to '_" "class" "'",rename="_%s") "class";
%namewarn("314"":""'" "continue" "' is a python keyword, renaming to '_" "continue" "'",rename="_%s") "continue";
%namewarn("314"":""'" "def" "' is a python keyword, renaming to '_" "def" "'",rename="_%s") "def";
%namewarn("314"":""'" "del" "' is a python keyword, renaming to '_" "del" "'",rename="_%s") "del";
%namewarn("314"":""'" "elif" "' is a python keyword, renaming to '_" "elif" "'",rename="_%s") "elif";
%namewarn("314"":""'" "else" "' is a python keyword, renaming to '_" "else" "'",rename="_%s") "else";
%namewarn("314"":""'" "except" "' is a python keyword, renaming to '_" "except" "'",rename="_%s") "except";
%namewarn("314"":""'" "exec" "' is a python keyword, renaming to '_" "exec" "'",rename="_%s") "exec";
%namewarn("314"":""'" "finally" "' is a python keyword, renaming to '_" "finally" "'",rename="_%s") "finally";
%namewarn("314"":""'" "for" "' is a python keyword, renaming to '_" "for" "'",rename="_%s") "for";
%namewarn("314"":""'" "from" "' is a python keyword, renaming to '_" "from" "'",rename="_%s") "from";
%namewarn("314"":""'" "global" "' is a python keyword, renaming to '_" "global" "'",rename="_%s") "global";
%namewarn("314"":""'" "if" "' is a python keyword, renaming to '_" "if" "'",rename="_%s") "if";
%namewarn("314"":""'" "import" "' is a python keyword, renaming to '_" "import" "'",rename="_%s") "import";
%namewarn("314"":""'" "in" "' is a python keyword, renaming to '_" "in" "'",rename="_%s") "in";
%namewarn("314"":""'" "is" "' is a python keyword, renaming to '_" "is" "'",rename="_%s") "is";
%namewarn("314"":""'" "lambda" "' is a python keyword, renaming to '_" "lambda" "'",rename="_%s") "lambda";
%namewarn("314"":""'" "not" "' is a python keyword, renaming to '_" "not" "'",rename="_%s") "not";
%namewarn("314"":""'" "or" "' is a python keyword, renaming to '_" "or" "'",rename="_%s") "or";
%namewarn("314"":""'" "pass" "' is a python keyword, renaming to '_" "pass" "'",rename="_%s") "pass";
%namewarn("314"":""'" "print" "' is a python keyword, renaming to '_" "print" "'",rename="_%s") "print";
%namewarn("314"":""'" "raise" "' is a python keyword, renaming to '_" "raise" "'",rename="_%s") "raise";
%namewarn("314"":""'" "return" "' is a python keyword, renaming to '_" "return" "'",rename="_%s") "return";
%namewarn("314"":""'" "try" "' is a python keyword, renaming to '_" "try" "'",rename="_%s") "try";
%namewarn("314"":""'" "while" "' is a python keyword, renaming to '_" "while" "'",rename="_%s") "while";
%namewarn("314"":""'" "with" "' is a python keyword, renaming to '_" "with" "'",rename="_%s") "with";
%namewarn("314"":""'" "yield" "' is a python keyword, renaming to '_" "yield" "'",rename="_%s") "yield";
/*
built-in functions
https://docs.python.org/2/library/functions.html
*/
%namewarn("321"":""'" "abs" "' conflicts with a built-in name in python", "match$kind"="function" ) "abs";
%namewarn("321"":""'" "apply" "' conflicts with a built-in name in python", "match$kind"="function" ) "apply";
%namewarn("321"":""'" "bool" "' conflicts with a built-in name in python", "match$kind"="function" ) "bool";
%namewarn("321"":""'" "buffer" "' conflicts with a built-in name in python", "match$kind"="function" ) "buffer";
%namewarn("321"":""'" "callable" "' conflicts with a built-in name in python", "match$kind"="function" ) "callable";
%namewarn("321"":""'" "chr" "' conflicts with a built-in name in python", "match$kind"="function" ) "chr";
%namewarn("321"":""'" "classmethod" "' conflicts with a built-in name in python", "match$kind"="function" ) "classmethod";
%namewarn("321"":""'" "cmp" "' conflicts with a built-in name in python", "match$kind"="function" ) "cmp";
%namewarn("321"":""'" "coerce" "' conflicts with a built-in name in python", "match$kind"="function" ) "coerce";
%namewarn("321"":""'" "compile" "' conflicts with a built-in name in python", "match$kind"="function" ) "compile";
%namewarn("321"":""'" "complex" "' conflicts with a built-in name in python", "match$kind"="function" ) "complex";
%namewarn("321"":""'" "delattr" "' conflicts with a built-in name in python", "match$kind"="function" ) "delattr";
%namewarn("321"":""'" "dict" "' conflicts with a built-in name in python", "match$kind"="function" ) "dict";
%namewarn("321"":""'" "dir" "' conflicts with a built-in name in python", "match$kind"="function" ) "dir";
%namewarn("321"":""'" "divmod" "' conflicts with a built-in name in python", "match$kind"="function" ) "divmod";
%namewarn("321"":""'" "enumerate" "' conflicts with a built-in name in python", "match$kind"="function" ) "enumerate";
%namewarn("321"":""'" "eval" "' conflicts with a built-in name in python", "match$kind"="function" ) "eval";
%namewarn("321"":""'" "execfile" "' conflicts with a built-in name in python", "match$kind"="function" ) "execfile";
%namewarn("321"":""'" "file" "' conflicts with a built-in name in python", "match$kind"="function" ) "file";
%namewarn("321"":""'" "filter" "' conflicts with a built-in name in python", "match$kind"="function" ) "filter";
%namewarn("321"":""'" "float" "' conflicts with a built-in name in python", "match$kind"="function" ) "float";
%namewarn("321"":""'" "frozenset" "' conflicts with a built-in name in python", "match$kind"="function" ) "frozenset";
%namewarn("321"":""'" "getattr" "' conflicts with a built-in name in python", "match$kind"="function" ) "getattr";
%namewarn("321"":""'" "globals" "' conflicts with a built-in name in python", "match$kind"="function" ) "globals";
%namewarn("321"":""'" "hasattr" "' conflicts with a built-in name in python", "match$kind"="function" ) "hasattr";
%namewarn("321"":""'" "hash" "' conflicts with a built-in name in python", "match$kind"="function" ) "hash";
%namewarn("321"":""'" "hex" "' conflicts with a built-in name in python", "match$kind"="function" ) "hex";
%namewarn("321"":""'" "id" "' conflicts with a built-in name in python", "match$kind"="function" ) "id";
%namewarn("321"":""'" "input" "' conflicts with a built-in name in python", "match$kind"="function" ) "input";
%namewarn("321"":""'" "int" "' conflicts with a built-in name in python", "match$kind"="function" ) "int";
%namewarn("321"":""'" "intern" "' conflicts with a built-in name in python", "match$kind"="function" ) "intern";
%namewarn("321"":""'" "isinstance" "' conflicts with a built-in name in python", "match$kind"="function" ) "isinstance";
%namewarn("321"":""'" "issubclass" "' conflicts with a built-in name in python", "match$kind"="function" ) "issubclass";
%namewarn("321"":""'" "iter" "' conflicts with a built-in name in python", "match$kind"="function" ) "iter";
%namewarn("321"":""'" "len" "' conflicts with a built-in name in python", "match$kind"="function" ) "len";
%namewarn("321"":""'" "list" "' conflicts with a built-in name in python", "match$kind"="function" ) "list";
%namewarn("321"":""'" "locals" "' conflicts with a built-in name in python", "match$kind"="function" ) "locals";
%namewarn("321"":""'" "long" "' conflicts with a built-in name in python", "match$kind"="function" ) "long";
%namewarn("321"":""'" "map" "' conflicts with a built-in name in python", "match$kind"="function" ) "map";
%namewarn("321"":""'" "max" "' conflicts with a built-in name in python", "match$kind"="function" ) "max";
%namewarn("321"":""'" "min" "' conflicts with a built-in name in python", "match$kind"="function" ) "min";
%namewarn("321"":""'" "object" "' conflicts with a built-in name in python", "match$kind"="function" ) "object";
%namewarn("321"":""'" "oct" "' conflicts with a built-in name in python", "match$kind"="function" ) "oct";
%namewarn("321"":""'" "open" "' conflicts with a built-in name in python", "match$kind"="function" ) "open";
%namewarn("321"":""'" "ord" "' conflicts with a built-in name in python", "match$kind"="function" ) "ord";
%namewarn("321"":""'" "pow" "' conflicts with a built-in name in python", "match$kind"="function" ) "pow";
%namewarn("321"":""'" "property" "' conflicts with a built-in name in python", "match$kind"="function" ) "property";
%namewarn("321"":""'" "range" "' conflicts with a built-in name in python", "match$kind"="function" ) "range";
%namewarn("321"":""'" "raw_input" "' conflicts with a built-in name in python", "match$kind"="function" ) "raw_input";
%namewarn("321"":""'" "reduce" "' conflicts with a built-in name in python", "match$kind"="function" ) "reduce";
%namewarn("321"":""'" "reload" "' conflicts with a built-in name in python", "match$kind"="function" ) "reload";
%namewarn("321"":""'" "repr" "' conflicts with a built-in name in python", "match$kind"="function" ) "repr";
%namewarn("321"":""'" "reversed" "' conflicts with a built-in name in python", "match$kind"="function" ) "reversed";
%namewarn("321"":""'" "round" "' conflicts with a built-in name in python", "match$kind"="function" ) "round";
%namewarn("321"":""'" "set" "' conflicts with a built-in name in python", "match$kind"="function" ) "set";
%namewarn("321"":""'" "setattr" "' conflicts with a built-in name in python", "match$kind"="function" ) "setattr";
%namewarn("321"":""'" "slice" "' conflicts with a built-in name in python", "match$kind"="function" ) "slice";
%namewarn("321"":""'" "sorted" "' conflicts with a built-in name in python", "match$kind"="function" ) "sorted";
%namewarn("321"":""'" "staticmethod" "' conflicts with a built-in name in python", "match$kind"="function" ) "staticmethod";
%namewarn("321"":""'" "str" "' conflicts with a built-in name in python", "match$kind"="function" ) "str";
%namewarn("321"":""'" "sum" "' conflicts with a built-in name in python", "match$kind"="function" ) "sum";
%namewarn("321"":""'" "super" "' conflicts with a built-in name in python", "match$kind"="function" ) "super";
%namewarn("321"":""'" "tuple" "' conflicts with a built-in name in python", "match$kind"="function" ) "tuple";
%namewarn("321"":""'" "type" "' conflicts with a built-in name in python", "match$kind"="function" ) "type";
%namewarn("321"":""'" "unichr" "' conflicts with a built-in name in python", "match$kind"="function" ) "unichr";
%namewarn("321"":""'" "unicode" "' conflicts with a built-in name in python", "match$kind"="function" ) "unicode";
%namewarn("321"":""'" "vars" "' conflicts with a built-in name in python", "match$kind"="function" ) "vars";
%namewarn("321"":""'" "xrange" "' conflicts with a built-in name in python", "match$kind"="function" ) "xrange";
%namewarn("321"":""'" "zip" "' conflicts with a built-in name in python", "match$kind"="function" ) "zip";
/*
built-in names
boolean type and None
*/
%namewarn("321"":""'" "True" "' conflicts with a built-in name in python", "match$kind"="function" ) "True";
%namewarn("321"":""'" "False" "' conflicts with a built-in name in python", "match$kind"="function" ) "False";
%namewarn("314"":""'" "None" "' is a python keyword, renaming to '_" "None" "'",rename="_%s") "None";
/*
'self' is also a bad Name
*/
%namewarn("314"":""'" "self" "' is a python keyword, renaming to '_" "self" "'",rename="_%s") "self";
%endoffile
/* ------------------------------------------------------------
* The Python autodoc support
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pydocs.swg" %beginfile
// Documentation for use with the autodoc feature.
%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)";
// Types to use in Python documentation for the parameters of the given C++ type.
%typemap(doctype) bool "boolean";
/*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,193,%formacro@*//*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,185,%_formacro_1@*//*@SWIG:/usr/share/swig/4.0.0/python/pydocs.swg,30,int_doctype_for_cppint_type@*/
%typemap(doctype) short, unsigned short "int";
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,185,%_formacro_1@*//*@SWIG:/usr/share/swig/4.0.0/python/pydocs.swg,30,int_doctype_for_cppint_type@*/
%typemap(doctype) int, unsigned int "int";
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,185,%_formacro_1@*//*@SWIG:/usr/share/swig/4.0.0/python/pydocs.swg,30,int_doctype_for_cppint_type@*/
%typemap(doctype) long, unsigned long "int";
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,185,%_formacro_1@*//*@SWIG:/usr/share/swig/4.0.0/python/pydocs.swg,30,int_doctype_for_cppint_type@*/
%typemap(doctype) long long, unsigned long long "int";
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG@*//*@SWIG@*/
%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)"
%endoffile
/* ------------------------------------------------------------
* The Python classes, for C++
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyclasses.swg" %beginfile
%endoffile
/* ------------------------------------------------------------
* The Python initialization function
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyinit.swg" %beginfile
/* ------------------------------------------------------------
* The start of the Python initialization function
* ------------------------------------------------------------ */
%insert(init) "swiginit.swg"
%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
%}
%insert("init") %{
#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(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
#if PY_VERSION_HEX >= 0x03000000
return PyUnicode_InternFromString("<Swig global variables>");
#else
return PyString_FromString("<Swig global variables>");
#endif
}
SWIGINTERN PyObject *
swig_varlink_str(swig_varlinkobject *v) {
#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(swig_varlinkobject *v) {
swig_globalvar *var = v->vars;
while (var) {
swig_globalvar *n = var->next;
free(var->name);
free(var);
var = n;
}
}
SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject *v, char *n) {
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(swig_varlinkobject *v, char *n, PyObject *p) {
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 */
0, /* tp_print */
(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
#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;
}
SWIGINTERN PyObject *
SWIG_globals(void) {
static PyObject *globals = 0;
if (!globals) {
globals = SWIG_newvarlink();
}
return globals;
}
/* -----------------------------------------------------------------------------
* 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);
}
}
}
/* -----------------------------------------------------------------------------*/
/* Fix SwigMethods to carry the callback ptrs when needed */
/* -----------------------------------------------------------------------------*/
SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef *methods,
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;
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;
}
}
}
}
}
}
/* -----------------------------------------------------------------------------
* 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
/* -----------------------------------------------------------------------------*
* 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);
%}
%endoffile
/* ------------------------------------------------------------
* For backward compatibility
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pybackward.swg" %beginfile
/*
adding backward compatibility macros
*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/primtypes.swg,341,%apply_checkctypes@*/
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {bool},"header", fragment="SWIG_" "AsVal" "_" {bool}) {
SWIGINTERNINLINE bool
SWIG_As_bool (PyObject* obj)
{
bool v;
int res = SWIG_AsVal_bool (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(bool));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {bool},"header",fragment="SWIG_" "AsVal" "_" {bool}) {
SWIGINTERNINLINE int
SWIG_Check_bool (PyObject* obj)
{
int res = SWIG_AsVal_bool (obj, (bool*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {signed char},"header", fragment="SWIG_" "AsVal" "_" {signed char}) {
SWIGINTERNINLINE signed char
SWIG_As_signed_SS_char (PyObject* obj)
{
signed char v;
int res = SWIG_AsVal_signed_SS_char (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(signed char));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {signed char},"header",fragment="SWIG_" "AsVal" "_" {signed char}) {
SWIGINTERNINLINE int
SWIG_Check_signed_SS_char (PyObject* obj)
{
int res = SWIG_AsVal_signed_SS_char (obj, (signed char*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned char},"header", fragment="SWIG_" "AsVal" "_" {unsigned char}) {
SWIGINTERNINLINE unsigned char
SWIG_As_unsigned_SS_char (PyObject* obj)
{
unsigned char v;
int res = SWIG_AsVal_unsigned_SS_char (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned char));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned char},"header",fragment="SWIG_" "AsVal" "_" {unsigned char}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_char (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_char (obj, (unsigned char*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {short},"header", fragment="SWIG_" "AsVal" "_" {short}) {
SWIGINTERNINLINE short
SWIG_As_short (PyObject* obj)
{
short v;
int res = SWIG_AsVal_short (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(short));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {short},"header",fragment="SWIG_" "AsVal" "_" {short}) {
SWIGINTERNINLINE int
SWIG_Check_short (PyObject* obj)
{
int res = SWIG_AsVal_short (obj, (short*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned short},"header", fragment="SWIG_" "AsVal" "_" {unsigned short}) {
SWIGINTERNINLINE unsigned short
SWIG_As_unsigned_SS_short (PyObject* obj)
{
unsigned short v;
int res = SWIG_AsVal_unsigned_SS_short (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned short));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned short},"header",fragment="SWIG_" "AsVal" "_" {unsigned short}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_short (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_short (obj, (unsigned short*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {int},"header", fragment="SWIG_" "AsVal" "_" {int}) {
SWIGINTERNINLINE int
SWIG_As_int (PyObject* obj)
{
int v;
int res = SWIG_AsVal_int (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(int));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {int},"header",fragment="SWIG_" "AsVal" "_" {int}) {
SWIGINTERNINLINE int
SWIG_Check_int (PyObject* obj)
{
int res = SWIG_AsVal_int (obj, (int*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned int},"header", fragment="SWIG_" "AsVal" "_" {unsigned int}) {
SWIGINTERNINLINE unsigned int
SWIG_As_unsigned_SS_int (PyObject* obj)
{
unsigned int v;
int res = SWIG_AsVal_unsigned_SS_int (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned int));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned int},"header",fragment="SWIG_" "AsVal" "_" {unsigned int}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_int (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_int (obj, (unsigned int*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {long},"header", fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERNINLINE long
SWIG_As_long (PyObject* obj)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(long));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {long},"header",fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERNINLINE int
SWIG_Check_long (PyObject* obj)
{
int res = SWIG_AsVal_long (obj, (long*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned long},"header", fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERNINLINE unsigned long
SWIG_As_unsigned_SS_long (PyObject* obj)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned long));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned long},"header",fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_long (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_long (obj, (unsigned long*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {long long},"header", fragment="SWIG_" "AsVal" "_" {long long}) {
SWIGINTERNINLINE long long
SWIG_As_long_SS_long (PyObject* obj)
{
long long v;
int res = SWIG_AsVal_long_SS_long (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(long long));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {long long},"header",fragment="SWIG_" "AsVal" "_" {long long}) {
SWIGINTERNINLINE int
SWIG_Check_long_SS_long (PyObject* obj)
{
int res = SWIG_AsVal_long_SS_long (obj, (long long*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned long long},"header", fragment="SWIG_" "AsVal" "_" {unsigned long long}) {
SWIGINTERNINLINE unsigned long long
SWIG_As_unsigned_SS_long_SS_long (PyObject* obj)
{
unsigned long long v;
int res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned long long));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned long long},"header",fragment="SWIG_" "AsVal" "_" {unsigned long long}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_long_SS_long (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, (unsigned long long*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {float},"header", fragment="SWIG_" "AsVal" "_" {float}) {
SWIGINTERNINLINE float
SWIG_As_float (PyObject* obj)
{
float v;
int res = SWIG_AsVal_float (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(float));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {float},"header",fragment="SWIG_" "AsVal" "_" {float}) {
SWIGINTERNINLINE int
SWIG_Check_float (PyObject* obj)
{
int res = SWIG_AsVal_float (obj, (float*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {double},"header", fragment="SWIG_" "AsVal" "_" {double}) {
SWIGINTERNINLINE double
SWIG_As_double (PyObject* obj)
{
double v;
int res = SWIG_AsVal_double (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(double));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {double},"header",fragment="SWIG_" "AsVal" "_" {double}) {
SWIGINTERNINLINE int
SWIG_Check_double (PyObject* obj)
{
int res = SWIG_AsVal_double (obj, (double*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {char},"header", fragment="SWIG_" "AsVal" "_" {char}) {
SWIGINTERNINLINE char
SWIG_As_char (PyObject* obj)
{
char v;
int res = SWIG_AsVal_char (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(char));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {char},"header",fragment="SWIG_" "AsVal" "_" {char}) {
SWIGINTERNINLINE int
SWIG_Check_char (PyObject* obj)
{
int res = SWIG_AsVal_char (obj, (char*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {wchar_t},"header", fragment="SWIG_" "AsVal" "_" {wchar_t}) {
SWIGINTERNINLINE wchar_t
SWIG_As_wchar_t (PyObject* obj)
{
wchar_t v;
int res = SWIG_AsVal_wchar_t (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(wchar_t));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {wchar_t},"header",fragment="SWIG_" "AsVal" "_" {wchar_t}) {
SWIGINTERNINLINE int
SWIG_Check_wchar_t (PyObject* obj)
{
int res = SWIG_AsVal_wchar_t (obj, (wchar_t*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {size_t},"header", fragment="SWIG_" "AsVal" "_" {size_t}) {
SWIGINTERNINLINE size_t
SWIG_As_size_t (PyObject* obj)
{
size_t v;
int res = SWIG_AsVal_size_t (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(size_t));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {size_t},"header",fragment="SWIG_" "AsVal" "_" {size_t}) {
SWIGINTERNINLINE int
SWIG_Check_size_t (PyObject* obj)
{
int res = SWIG_AsVal_size_t (obj, (size_t*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {ptrdiff_t},"header", fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) {
SWIGINTERNINLINE ptrdiff_t
SWIG_As_ptrdiff_t (PyObject* obj)
{
ptrdiff_t v;
int res = SWIG_AsVal_ptrdiff_t (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(ptrdiff_t));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {ptrdiff_t},"header",fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) {
SWIGINTERNINLINE int
SWIG_Check_ptrdiff_t (PyObject* obj)
{
int res = SWIG_AsVal_ptrdiff_t (obj, (ptrdiff_t*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG@*/
%endoffile
%endoffile
%includefile(maininput="../mapscript.i") "../mapscript.i" %beginfile
/*
===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for the MapServer mapscript module
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2005 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
============================================================================
*/
%module mapscript
%feature("new") msLoadMapFromString;
%{
#include "../../mapserver.h"
#include "../../maptemplate.h"
#include "../../mapogcsld.h"
#include "../../mapows.h"
#include "../../cgiutil.h"
#include "../../mapcopy.h"
#include "../../maperror.h"
#include "../../mapprimitive.h"
#include "../../mapshape.h"
#if defined(WIN32) && defined(SWIGCSHARP)
/* <windows.h> is needed for GetExceptionCode() for unhandled exception */
#include <windows.h>
#endif
%}
/* Problem with SWIG CSHARP typemap for pointers */
%includefile "/usr/share/swig/4.0.0/python/typemaps.i" %beginfile
/* -----------------------------------------------------------------------------
* 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 <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);
*/
// 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).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 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 <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 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.
*/
%includefile "/usr/share/swig/4.0.0/typemaps/typemaps.swg" %beginfile
/* -----------------------------------------------------------------------------
* typemaps.swg
*
* Tcl 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);
*/
// 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 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).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 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 Tcl 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 <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 :
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.
*/
%endoffile
%endoffile
%includefile "/usr/share/swig/4.0.0/constraints.i" %beginfile
/* -----------------------------------------------------------------------------
* constraints.i
*
* SWIG constraints library.
*
* SWIG library file containing typemaps for implementing various kinds of
* constraints. Depends upon the SWIG exception library for generating
* errors in a language-independent manner.
* ----------------------------------------------------------------------------- */
%includefile "/usr/share/swig/4.0.0/python/exception.i" %beginfile
%insert("runtime") {
#define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
}
%endoffile
// Positive numbers
%typemap(check )
int POSITIVE,
short POSITIVE,
long POSITIVE,
unsigned int POSITIVE,
unsigned short POSITIVE,
unsigned long POSITIVE,
signed char POSITIVE,
unsigned char POSITIVE,
float POSITIVE,
double POSITIVE,
Number POSITIVE
{
if ($1 <= 0) {
SWIG_exception(SWIG_ValueError,"Expected a positive value.");
}
}
// Negative numbers
%typemap(check )
int NEGATIVE,
short NEGATIVE,
long NEGATIVE,
unsigned int NEGATIVE,
unsigned short NEGATIVE,
unsigned long NEGATIVE,
signed char NEGATIVE,
unsigned char NEGATIVE,
float NEGATIVE,
double NEGATIVE,
Number NEGATIVE
{
if ($1 >= 0) {
SWIG_exception(SWIG_ValueError,"Expected a negative value.");
}
}
// Nonzero numbers
%typemap(check )
int NONZERO,
short NONZERO,
long NONZERO,
unsigned int NONZERO,
unsigned short NONZERO,
unsigned long NONZERO,
signed char NONZERO,
unsigned char NONZERO,
float NONZERO,
double NONZERO,
Number NONZERO
{
if ($1 == 0) {
SWIG_exception(SWIG_ValueError,"Expected a nonzero value.");
}
}
// Nonnegative numbers
%typemap(check )
int NONNEGATIVE,
short NONNEGATIVE,
long NONNEGATIVE,
unsigned int NONNEGATIVE,
unsigned short NONNEGATIVE,
unsigned long NONNEGATIVE,
signed char NONNEGATIVE,
unsigned char NONNEGATIVE,
float NONNEGATIVE,
double NONNEGATIVE,
Number NONNEGATIVE
{
if ($1 < 0) {
SWIG_exception(SWIG_ValueError,"Expected a non-negative value.");
}
}
// Nonpositive numbers
%typemap(check )
int NONPOSITIVE,
short NONPOSITIVE,
long NONPOSITIVE,
unsigned int NONPOSITIVE,
unsigned short NONPOSITIVE,
unsigned long NONPOSITIVE,
signed char NONPOSITIVE,
unsigned char NONPOSITIVE,
float NONPOSITIVE,
double NONPOSITIVE,
Number NONPOSITIVE
{
if ($1 > 0) {
SWIG_exception(SWIG_ValueError,"Expected a non-positive value.");
}
}
// Non-NULL pointer
%typemap(check )
void * NONNULL,
Pointer NONNULL
{
if (!$1) {
SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
}
}
// Aligned pointers
%typemap(check )
void * ALIGN8,
Pointer ALIGN8
{
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 7) {
SWIG_exception(SWIG_ValueError,"Pointer must be 8-byte aligned.");
}
}
%typemap(check )
void * ALIGN4,
Pointer ALIGN4
{
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 3) {
SWIG_exception(SWIG_ValueError,"Pointer must be 4-byte aligned.");
}
}
%typemap(check )
void * ALIGN2,
Pointer ALIGN2
{
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 1) {
SWIG_exception(SWIG_ValueError,"Pointer must be 2-byte aligned.");
}
}
%endoffile
%includefile "/usr/share/swig/4.0.0/python/carrays.i" %beginfile
%includefile "/usr/share/swig/4.0.0/typemaps/carrays.swg" %beginfile
/* -----------------------------------------------------------------------------
* carrays.swg
*
* This library file contains macros that can be used to manipulate simple
* pointers as arrays.
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* %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);
*
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* %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 * cast();
* static NAME *frompointer(TYPE *t);
* }
*
* Use
*
* %array_class_wrap(TYPE,NAME,GET,SET)
*
* if you want different names for the get/set methods.
* ----------------------------------------------------------------------------- */
%endoffile
%endoffile
/*@SWIG:/usr/share/swig/4.0.0/python/carrays.i,1,%array_class@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/carrays.swg,69,%array_class_wrap@*/
%{
typedef int intarray;
%}
typedef struct {
} intarray;
%extend intarray {
intarray(size_t nelements) {
return (int *)calloc(nelements, sizeof(int));
}
~intarray() {
free((char*)self);
}
int __getitem__(size_t index) {
return self[index];
}
void __setitem__(size_t index, int value) {
self[index] = value;
}
int * cast() {
return self;
}
static intarray *frompointer(int *t) {
return (intarray *)(t);
}
};
%types(intarray = int);
/*@SWIG@*/
/*@SWIG@*/
/*
===========================================================================
Supporting 'None' as an argument to attribute accessor functions
Typemaps to support NULL in attribute accessor functions
provided to Steve Lime by David Beazley and tested for Python
only by Sean Gillies.
With the use of these typemaps we can execute statements like
layer.group = None
============================================================================
*/
%typemap(memberin) char * {
if ($1) free((char*)$1);
if ($input) {
$1 = ($1_type) malloc(strlen($input)+1);
strcpy((char*)$1,$input);
} else {
$1 = 0;
}
}
%typemap(memberin,warning="451:Setting const char * member may leak
memory.") const char * {
if ($input) {
$1 = ($1_type) malloc(strlen($input)+1);
strcpy((char*)$1,$input);
} else {
$1 = 0;
}
}
%typemap(globalin) char * {
if ($1) free((char*)$1);
if ($input) {
$1 = ($1_type) malloc(strlen($input)+1);
strcpy((char*)$1,$input);
} else {
$1 = 0;
}
}
%typemap(globalin,warning="451:Setting const char * variable may leak
memory.") const char * {
if ($input) {
$1 = ($1_type) malloc(strlen($input)+1);
strcpy((char*)$1,$input);
} else {
$1 = 0;
}
}
/* GD Buffer Mapping for use with imageObj::getBytes */
%{
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
unsigned char *data;
int size;
int owns_data;
} gdBuffer;
#ifdef __cplusplus
}
#endif
%}
/*
============================================================================
Exceptions
Note: Python exceptions are in pymodule.i
============================================================================
*/
/*
============================================================================
Language-specific module code
============================================================================
*/
/* C# */
/* Java */
/* Python */
%includefile "pymodule.i" %beginfile
/******************************************************************************
* Project: MapServer
* Purpose: Python-specific enhancements to MapScript
* Author: Sean Gillies, sgillies@frii.com
*
******************************************************************************
*
* Python-specific mapscript code has been moved into this
* SWIG interface file to improve the readability of the main
* interface file. The main mapscript.i file includes this
* file when SWIGPYTHON is defined (via 'swig -python ...').
*
*****************************************************************************/
/******************************************************************************
* Simple Typemaps
*****************************************************************************/
/* Translates Python None to C NULL for strings */
%typemap(in,parse="z") char * "";
/* To support imageObj::getBytes */
%typemap(out) gdBuffer {
$result = PyBytes_FromStringAndSize((const char*)$1.data, $1.size);
if( $1.owns_data )
msFree($1.data);
}
/*
* Typemap for counted arrays of doubles <- PySequence
*/
%typemap(in,numinputs=1) (int nListSize, double* pListValues)
{
int i;
/* %typemap(in,numinputs=1) (int nListSize, double* pListValues)*/
/* check if is List */
if ( !PySequence_Check($input) ) {
PyErr_SetString(PyExc_TypeError, "not a sequence");
SWIG_fail;
}
$1 = PySequence_Size($input);
$2 = (double*) malloc($1*sizeof(double));
for( i = 0; i<$1; i++ ) {
PyObject *o = PySequence_GetItem($input,i);
if ( !PyArg_Parse(o,"d",&$2[i]) ) {
PyErr_SetString(PyExc_TypeError, "not a number");
Py_DECREF(o);
SWIG_fail;
}
Py_DECREF(o);
}
}
%fragment("CreateTupleFromDoubleArray","header") %{
static PyObject *
CreateTupleFromDoubleArray( double *first, unsigned int size ) {
unsigned int i;
PyObject *out = PyTuple_New( size );
for( i=0; i<size; i++ ) {
PyObject *val = PyFloat_FromDouble( *first );
++first;
PyTuple_SetItem( out, i, val );
}
return out;
}
%}
%typemap(freearg) (int nListSize, double* pListValues)
{
/* %typemap(freearg) (int nListSize, double* pListValues) */
if ($2) {
free((void*) $2);
}
}
%typemap(in,numinputs=0) (double** argout, int* pnListSize) ( double* argout, int nListSize ) {
/* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
$1 = &argout;
$2 = &nListSize;
}
%typemap(argout,fragment="t_output_helper,CreateTupleFromDoubleArray") (double** argout, int* pnListSize)
{
/* %typemap(argout) (double* argout, int* pnListSize) */
PyObject *r;
r = CreateTupleFromDoubleArray(*$1, *$2);
free(*$1);
$result = t_output_helper($result,r);
}
/**************************************************************************
* MapServer Errors and Python Exceptions
**************************************************************************
*
* Translation of errors reported via the ms_error structure into
* Python exceptions. Original code by Chris Chamberlin <cdc@aracnet.com>
* has been updated by Sean Gillies <sgillies@frii.com> to use
* PyErr_SetString, %exception and $action for SWIG 1.3, do the most
* obvious mapping of MapServer errors to Python exceptions and map all
* others to a new 'MapServerError' exception which can be caught like this:
*
* from mapscript import *
* empty_map = mapObj('')
* try:
* img = empty_map.draw()
* except MapServerError, msg:
* print "Caught MapServerError:", msg
*
*************************************************************************/
%{
PyObject *MSExc_MapServerError;
PyObject *MSExc_MapServerChildError;
%}
/* Module initialization: call msSetup() and register msCleanup() */
%insert("init") %{
/* See bug 1203 for discussion of race condition with GD font cache */
if (msSetup() != MS_SUCCESS)
{
msSetError(MS_MISCERR, "Failed to set up threads and font cache",
"msSetup()");
}
Py_AtExit(msCleanup);
/* Define Generic MapServer error */
MSExc_MapServerError=PyErr_NewException("_mapscript.MapServerError",NULL,NULL);
if (MSExc_MapServerError != NULL)
PyDict_SetItemString(d, "MapServerError", MSExc_MapServerError);
/* Define MapServer MS_CHILD error */
MSExc_MapServerChildError = PyErr_NewException("_mapscript.MapServerChildError", NULL, NULL);
if (MSExc_MapServerChildError != NULL)
PyDict_SetItemString(d, "MapServerChildError", MSExc_MapServerChildError);
%}
%{
static void _raise_ms_exception( void );
static void _raise_ms_exception() {
int errcode;
errorObj *ms_error;
char *errmsg;
ms_error = msGetErrorObj();
errcode = ms_error->code;
errmsg = msGetErrorString("\n");
switch (errcode) {
case MS_IOERR:
PyErr_SetString(PyExc_IOError, errmsg);
break;
case MS_MEMERR:
PyErr_SetString(PyExc_MemoryError, errmsg);
break;
case MS_TYPEERR:
PyErr_SetString(PyExc_TypeError, errmsg);
break;
case MS_EOFERR:
PyErr_SetString(PyExc_EOFError, errmsg);
break;
case MS_CHILDERR:
PyErr_SetString(MSExc_MapServerChildError, errmsg);
break;
default:
PyErr_SetString(MSExc_MapServerError, errmsg);
break;
}
free(errmsg);
}
%}
%feature("except") {
$action {
errorObj *ms_error = msGetErrorObj();
switch(ms_error->code) {
case MS_NOERR:
break;
case MS_NOTFOUND:
msResetErrorList();
break;
case -1:
break;
case MS_IOERR:
if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
_raise_ms_exception();
msResetErrorList();
return NULL;
}
default:
_raise_ms_exception();
msResetErrorList();
return NULL;
}
}
}
%insert("python") %{
MapServerError = _mapscript.MapServerError
MapServerChildError = _mapscript.MapServerChildError
%}
/* The bogus "if 1:" is to introduce a new scope to work around indentation
handling with pythonappend in different versions. (#3180) */
%feature("pythonappend") layerObj %{if 1:
self.p_map=None
try:
# python 2.5
if args and len(args)!=0:
self.p_map=args[0]
except NameError:
# python 2.6
if map:
self.p_map=map
%}
/* The bogus "if 1:" is to introduce a new scope to work around indentation
handling with pythonappend in different versions. (#3180) */
%feature("pythonappend") classObj %{if 1:
self.p_layer =None
try:
# python 2.5
if args and len(args)!=0:
self.p_layer=args[0]
except NameError:
# python 2.6
if layer:
self.p_layer=layer
%}
%feature("shadow") insertClass %{
def insertClass(*args):
actualIndex=$action(*args)
args[1].p_layer=args[0]
return actualIndex%}
%feature("shadow") getClass %{
def getClass(*args):
clazz = $action(*args)
if clazz:
if args and len(args)!=0:
clazz.p_layer=args[0]
else:
clazz.p_layer=None
return clazz%}
%feature("shadow") insertLayer %{
def insertLayer(*args):
actualIndex=$action(*args)
args[1].p_map=args[0]
return actualIndex%}
%feature("shadow") getLayer %{
def getLayer(*args):
layer = $action(*args)
if layer:
if args and len(args)!=0:
layer.p_map=args[0]
else:
layer.p_map=None
return layer%}
%feature("shadow") getLayerByName %{
def getLayerByName(*args):
layer = $action(*args)
if layer:
if args and len(args)!=0:
layer.p_map=args[0]
else:
layer.p_map=None
return layer%}
%endoffile
/* Ruby */
/* Perl */
/* Tcl */
/* PHP7 */
/*
=============================================================================
Wrap MapServer structs into mapscript classes
=============================================================================
*/
%includefile "../../mapserver.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Primary MapServer include file.
* Author: Steve Lime and the MapServer team.
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
/*
** Main includes. If a particular header was needed by several .c files then
** I just put it here. What the hell, it works and it's all right here. -SDL-
*/
/* definition of ms_int32/ms_uint32 */
typedef int32_t ms_int32;
typedef uint32_t ms_uint32;
/* ms_bitarray is used by the bit mask in mapbit.c */
typedef ms_uint32 * ms_bitarray;
typedef const ms_uint32 *ms_const_bitarray;
/* The regex lib from the system and the regex lib from PHP needs to
* be separated here. We separate here via its directory location.
*/
/* EQUAL and EQUALN are defined in cpl_port.h, so add them in here if ogr was not included */
// hide from swig or ruby will choke on the __FUNCTION__ name
/* General defines, wrapable */
%constant MS_TRUE = 1; /* logical control variables */
%constant MS_FALSE = 0;
%constant MS_UNKNOWN = -1;
%constant MS_ON = 1;
%constant MS_OFF = 0;
%constant MS_DEFAULT = 2;
%constant MS_EMBED = 3;
%constant MS_DELETE = 4;
%constant MS_YES = 1;
%constant MS_NO = 0;
/* Number of layer, class and style ptrs to alloc at once in the
corresponding msGrow...() functions. Replaces former MS_MAXLAYERS,
MS_MAXCLASSES and MS_MAXSTYLES with dynamic allocation (see RFC-17). */
%constant MS_LAYER_ALLOCSIZE = 64;
%constant MS_CLASS_ALLOCSIZE = 8;
%constant MS_STYLE_ALLOCSIZE = 4;
%constant MS_LABEL_ALLOCSIZE = 2; /* not too common */
%constant MS_MAX_LABEL_PRIORITY = 10;
%constant MS_MAX_LABEL_FONTS = 5;
%constant MS_DEFAULT_LABEL_PRIORITY = 1;
%constant MS_LABEL_FORCE_GROUP = 2; /* other values are MS_ON/MS_OFF */
/* General defines, not wrapable */
%constant MS_RENDER_WITH_SWF = 2;
%constant MS_RENDER_WITH_RAWDATA = 3;
%constant MS_RENDER_WITH_IMAGEMAP = 5;
%constant MS_RENDER_WITH_TEMPLATE = 8; /* query results only */
%constant MS_RENDER_WITH_OGR = 16;
%constant MS_RENDER_WITH_PLUGIN = 100;
%constant MS_RENDER_WITH_CAIRO_RASTER = 101;
%constant MS_RENDER_WITH_CAIRO_PDF = 102;
%constant MS_RENDER_WITH_CAIRO_SVG = 103;
%constant MS_RENDER_WITH_OGL = 104;
%constant MS_RENDER_WITH_AGG = 105;
%constant MS_RENDER_WITH_KML = 106;
%constant MS_RENDER_WITH_UTFGRID = 107;
%constant MS_RENDER_WITH_MVT = 108;
/* General enumerated types - needed by scripts */
enum MS_FILE_TYPE {MS_FILE_MAP, MS_FILE_SYMBOL};
enum MS_UNITS {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD, MS_PIXELS, MS_PERCENTAGES, MS_NAUTICALMILES};
enum MS_SHAPE_TYPE {MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, MS_SHAPE_NULL};
enum MS_LAYER_TYPE {MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON, MS_LAYER_RASTER, MS_LAYER_ANNOTATION /* only used for parser backwards compatibility */, MS_LAYER_QUERY, MS_LAYER_CIRCLE, MS_LAYER_TILEINDEX, MS_LAYER_CHART};
enum MS_FONT_TYPE {MS_TRUETYPE, MS_BITMAP};
%constant MS_POSITIONS_LENGTH = 14;
enum MS_POSITIONS_ENUM {MS_UL=101, MS_LR, MS_UR, MS_LL, MS_CR, MS_CL, MS_UC, MS_LC, MS_CC, MS_AUTO, MS_XY, MS_NONE, MS_AUTO2,MS_FOLLOW};
%constant MS_TINY = 5;
%constant MS_SMALL = 7;
%constant MS_MEDIUM = 10;
%constant MS_LARGE = 13;
%constant MS_GIANT = 16;
enum MS_QUERYMAP_STYLES {MS_NORMAL, MS_HILITE, MS_SELECTED};
enum MS_CONNECTION_TYPE {MS_INLINE, MS_SHAPEFILE, MS_TILED_SHAPEFILE, MS_UNUSED_2, MS_OGR, MS_UNUSED_1, MS_POSTGIS, MS_WMS, MS_ORACLESPATIAL, MS_WFS, MS_GRATICULE, MS_MYSQL, MS_RASTER, MS_PLUGIN, MS_UNION, MS_UVRASTER, MS_CONTOUR, MS_KERNELDENSITY };
enum MS_JOIN_CONNECTION_TYPE {MS_DB_XBASE, MS_DB_CSV, MS_DB_MYSQL, MS_DB_ORACLE, MS_DB_POSTGRES};
enum MS_JOIN_TYPE {MS_JOIN_ONE_TO_ONE, MS_JOIN_ONE_TO_MANY};
%constant MS_SINGLE = 0; /* modes for searching (spatial/database) */
%constant MS_MULTIPLE = 1;
enum MS_QUERY_MODE {MS_QUERY_SINGLE, MS_QUERY_MULTIPLE};
enum MS_QUERY_TYPE {MS_QUERY_IS_NULL, MS_QUERY_BY_POINT, MS_QUERY_BY_RECT, MS_QUERY_BY_SHAPE, MS_QUERY_BY_ATTRIBUTE, MS_QUERY_BY_INDEX, MS_QUERY_BY_FILTER};
enum MS_ALIGN_VALUE {MS_ALIGN_DEFAULT, MS_ALIGN_LEFT, MS_ALIGN_CENTER, MS_ALIGN_RIGHT};
enum MS_CAPS_JOINS_AND_CORNERS {MS_CJC_NONE, MS_CJC_BEVEL, MS_CJC_BUTT, MS_CJC_MITER, MS_CJC_ROUND, MS_CJC_SQUARE, MS_CJC_TRIANGLE};
%constant MS_CJC_DEFAULT_JOIN_MAXSIZE = 3;
enum MS_RETURN_VALUE {MS_SUCCESS, MS_FAILURE, MS_DONE};
enum MS_IMAGEMODE { MS_IMAGEMODE_PC256, MS_IMAGEMODE_RGB, MS_IMAGEMODE_RGBA, MS_IMAGEMODE_INT16, MS_IMAGEMODE_FLOAT32, MS_IMAGEMODE_BYTE, MS_IMAGEMODE_FEATURE, MS_IMAGEMODE_NULL };
enum MS_GEOS_OPERATOR {MS_GEOS_EQUALS, MS_GEOS_DISJOINT, MS_GEOS_TOUCHES, MS_GEOS_OVERLAPS, MS_GEOS_CROSSES, MS_GEOS_INTERSECTS, MS_GEOS_WITHIN, MS_GEOS_CONTAINS, MS_GEOS_BEYOND, MS_GEOS_DWITHIN};
/* coordinate to pixel simplification modes, used in msTransformShape */
enum MS_TRANSFORM_MODE {
MS_TRANSFORM_NONE, /* no geographic to pixel transformation */
MS_TRANSFORM_ROUND, /* round to integer, might create degenerate geometries (used for GD)*/
MS_TRANSFORM_SNAPTOGRID, /* snap to a grid, should be user configurable in the future*/
MS_TRANSFORM_FULLRESOLUTION, /* keep full resolution */
MS_TRANSFORM_SIMPLIFY /* keep full resolution */
};
typedef enum {
MS_COMPOP_CLEAR,
MS_COMPOP_SRC,
MS_COMPOP_DST,
MS_COMPOP_SRC_OVER,
MS_COMPOP_DST_OVER,
MS_COMPOP_SRC_IN,
MS_COMPOP_DST_IN,
MS_COMPOP_SRC_OUT,
MS_COMPOP_DST_OUT,
MS_COMPOP_SRC_ATOP,
MS_COMPOP_DST_ATOP,
MS_COMPOP_XOR,
MS_COMPOP_PLUS,
MS_COMPOP_MINUS,
MS_COMPOP_MULTIPLY,
MS_COMPOP_SCREEN,
MS_COMPOP_OVERLAY,
MS_COMPOP_DARKEN,
MS_COMPOP_LIGHTEN,
MS_COMPOP_COLOR_DODGE,
MS_COMPOP_COLOR_BURN,
MS_COMPOP_HARD_LIGHT,
MS_COMPOP_SOFT_LIGHT,
MS_COMPOP_DIFFERENCE,
MS_COMPOP_EXCLUSION,
MS_COMPOP_CONTRAST,
MS_COMPOP_INVERT,
MS_COMPOP_INVERT_RGB
} CompositingOperation;
typedef struct _CompositingFilter{
char *filter;
struct _CompositingFilter *next;
} CompositingFilter;
typedef struct _LayerCompositer{
CompositingOperation comp_op;
int opacity;
CompositingFilter *filter;
struct _LayerCompositer *next;
} LayerCompositer;
/* Define supported bindings here (only covers existing bindings at first). Not accessible directly using MapScript. */
%constant MS_STYLE_BINDING_LENGTH = 12;
enum MS_STYLE_BINDING_ENUM { MS_STYLE_BINDING_SIZE, MS_STYLE_BINDING_WIDTH, MS_STYLE_BINDING_ANGLE, MS_STYLE_BINDING_COLOR, MS_STYLE_BINDING_OUTLINECOLOR, MS_STYLE_BINDING_SYMBOL, MS_STYLE_BINDING_OUTLINEWIDTH, MS_STYLE_BINDING_OPACITY, MS_STYLE_BINDING_OFFSET_X, MS_STYLE_BINDING_OFFSET_Y, MS_STYLE_BINDING_POLAROFFSET_PIXEL, MS_STYLE_BINDING_POLAROFFSET_ANGLE };
%constant MS_LABEL_BINDING_LENGTH = 9;
enum MS_LABEL_BINDING_ENUM { MS_LABEL_BINDING_SIZE, MS_LABEL_BINDING_ANGLE, MS_LABEL_BINDING_COLOR, MS_LABEL_BINDING_OUTLINECOLOR, MS_LABEL_BINDING_FONT, MS_LABEL_BINDING_PRIORITY, MS_LABEL_BINDING_POSITION, MS_LABEL_BINDING_SHADOWSIZEX, MS_LABEL_BINDING_SHADOWSIZEY };
/************************************************************************/
/* attributeBindingObj */
/************************************************************************/
/************************************************************************/
/* labelPathObj */
/* */
/* Label path object - used to hold path and bounds of curved */
/* labels - Bug #1620 implementation. */
/************************************************************************/
/************************************************************************/
/* fontSetObj */
/* */
/* used to hold aliases for TRUETYPE fonts */
/************************************************************************/
typedef struct {
%feature("immutable");
char *filename;
int numfonts;
hashTableObj fonts;
%feature("immutable","");
} fontSetObj;
/************************************************************************/
/* featureListNodeObj */
/* */
/* for inline features, shape caches and queries */
/************************************************************************/
/************************************************************************/
/* paletteObj */
/* */
/* used to hold colors while a map file is read */
/************************************************************************/
/************************************************************************/
/* expressionObj & tokenObj */
/************************************************************************/
enum MS_TOKEN_LOGICAL_ENUM { MS_TOKEN_LOGICAL_AND=300, MS_TOKEN_LOGICAL_OR, MS_TOKEN_LOGICAL_NOT };
enum MS_TOKEN_LITERAL_ENUM { MS_TOKEN_LITERAL_NUMBER=310, MS_TOKEN_LITERAL_STRING, MS_TOKEN_LITERAL_TIME, MS_TOKEN_LITERAL_SHAPE, MS_TOKEN_LITERAL_BOOLEAN };
enum MS_TOKEN_COMPARISON_ENUM {
MS_TOKEN_COMPARISON_EQ=320, MS_TOKEN_COMPARISON_NE, MS_TOKEN_COMPARISON_GT, MS_TOKEN_COMPARISON_LT, MS_TOKEN_COMPARISON_LE, MS_TOKEN_COMPARISON_GE, MS_TOKEN_COMPARISON_IEQ,
MS_TOKEN_COMPARISON_RE, MS_TOKEN_COMPARISON_IRE,
MS_TOKEN_COMPARISON_IN, MS_TOKEN_COMPARISON_LIKE,
MS_TOKEN_COMPARISON_INTERSECTS, MS_TOKEN_COMPARISON_DISJOINT, MS_TOKEN_COMPARISON_TOUCHES, MS_TOKEN_COMPARISON_OVERLAPS, MS_TOKEN_COMPARISON_CROSSES, MS_TOKEN_COMPARISON_WITHIN, MS_TOKEN_COMPARISON_CONTAINS, MS_TOKEN_COMPARISON_EQUALS, MS_TOKEN_COMPARISON_BEYOND, MS_TOKEN_COMPARISON_DWITHIN
};
enum MS_TOKEN_FUNCTION_ENUM {
MS_TOKEN_FUNCTION_LENGTH=350, MS_TOKEN_FUNCTION_TOSTRING, MS_TOKEN_FUNCTION_COMMIFY, MS_TOKEN_FUNCTION_AREA, MS_TOKEN_FUNCTION_ROUND, MS_TOKEN_FUNCTION_FROMTEXT,
MS_TOKEN_FUNCTION_BUFFER, MS_TOKEN_FUNCTION_DIFFERENCE, MS_TOKEN_FUNCTION_SIMPLIFY, MS_TOKEN_FUNCTION_SIMPLIFYPT, MS_TOKEN_FUNCTION_GENERALIZE, MS_TOKEN_FUNCTION_SMOOTHSIA, MS_TOKEN_FUNCTION_JAVASCRIPT,
MS_TOKEN_FUNCTION_UPPER, MS_TOKEN_FUNCTION_LOWER, MS_TOKEN_FUNCTION_INITCAP, MS_TOKEN_FUNCTION_FIRSTCAP
};
enum MS_TOKEN_BINDING_ENUM { MS_TOKEN_BINDING_DOUBLE=370, MS_TOKEN_BINDING_INTEGER, MS_TOKEN_BINDING_STRING, MS_TOKEN_BINDING_TIME, MS_TOKEN_BINDING_SHAPE, MS_TOKEN_BINDING_MAP_CELLSIZE, MS_TOKEN_BINDING_DATA_CELLSIZE };
enum MS_PARSE_TYPE_ENUM { MS_PARSE_TYPE_BOOLEAN, MS_PARSE_TYPE_STRING, MS_PARSE_TYPE_SHAPE };
/* MS RFC 69*/
typedef struct {
double maxdistance; /* max distance between clusters */
double buffer; /* the buffer size around the selection area */
char* region; /* type of the cluster region (rectangle or ellipse) */
} clusterObj;
/************************************************************************/
/* joinObj */
/* */
/* simple way to access other XBase files, one-to-one or */
/* one-to-many supported */
/************************************************************************/
/************************************************************************/
/* outputFormatObj */
/* */
/* see mapoutput.c for most related code. */
/************************************************************************/
typedef struct {
%feature("immutable");
int numformatoptions;
%feature("immutable","");
char *name;
char *mimetype;
char *driver;
char *extension;
int renderer; /* MS_RENDER_WITH_* */
int imagemode; /* MS_IMAGEMODE_* value. */
int transparent;
int bands;
int inmapfile; /* boolean value for writing */
} outputFormatObj;
/* The following is used for "don't care" values in transparent, interlace and
imagequality values. */
%constant MS_NOOVERRIDE = -1111;
/************************************************************************/
/* queryObj */
/* */
/* encapsulates the information necessary to perform a query */
/************************************************************************/
/************************************************************************/
/* queryMapObj */
/* */
/* used to visualize query results */
/************************************************************************/
typedef struct {
int height, width;
int status;
int style; /* HILITE, SELECTED or NORMAL */
colorObj color;
} queryMapObj;
/************************************************************************/
/* webObj */
/* */
/* holds parameters for a mapserver/mapscript interface */
/************************************************************************/
typedef struct {
char *log;
char *imagepath, *imageurl, *temppath;
%feature("immutable");
struct mapObj *map;
%feature("immutable","");
char *template;
char *header, *footer;
char *empty, *error; /* error handling */
rectObj extent; /* clipping extent */
double minscaledenom, maxscaledenom;
char *mintemplate, *maxtemplate;
char *queryformat; /* what format is the query to be returned, given as a MIME type */
char *legendformat;
char *browseformat;
%feature("immutable");
hashTableObj metadata;
hashTableObj validation;
%feature("immutable","");
} webObj;
/************************************************************************/
/* styleObj */
/* */
/* holds parameters for symbolization, multiple styles may be */
/* applied within a classObj */
/************************************************************************/
struct styleObj{
%feature("immutable");
int refcount;
%feature("immutable","");
/*should an angle be automatically computed*/
int autoangle;
colorObj color;
colorObj backgroundcolor;
colorObj outlinecolor;
int opacity;
/* Stuff to handle Color Range Styles */
colorObj mincolor;
colorObj maxcolor;
double minvalue;
double maxvalue;
char *rangeitem;
int rangeitemindex;
int symbol;
char *symbolname;
double size;
double minsize, maxsize;
%feature("immutable");
int patternlength; /*moved from symbolObj in version 6.0*/
%feature("immutable","");
double gap; /*moved from symbolObj in version 6.0*/
double initialgap;
int position; /*moved from symbolObj in version 6.0*/
int linecap, linejoin; /*moved from symbolObj in version 6.0*/
double linejoinmaxsize; /*moved from symbolObj in version 6.0*/
double width;
double outlinewidth;
double minwidth, maxwidth;
double offsetx, offsety; /* for shadows, hollow symbols, etc... */
double polaroffsetpixel, polaroffsetangle;
double angle;
double minscaledenom, maxscaledenom;
};
%constant MS_STYLE_SINGLE_SIDED_OFFSET = -99;
%constant MS_STYLE_DOUBLE_SIDED_OFFSET = -999;
/********************************************************************/
/* labelLeaderObj */
/* */
/* parameters defining how a label or a group of labels may be */
/* offsetted from its original position */
/********************************************************************/
typedef struct {
int maxdistance;
int gridstep;
%feature("immutable");
int numstyles;
%feature("immutable","");
} labelLeaderObj;
/************************************************************************/
/* labelObj */
/* */
/* parameters needed to annotate a layer, legend or scalebar */
/************************************************************************/
struct labelObj{
%feature("immutable");
int refcount;
%feature("immutable","");
char *font;
colorObj color;
colorObj outlinecolor;
int outlinewidth;
colorObj shadowcolor;
int shadowsizex, shadowsizey;
int size;
int minsize, maxsize;
int position;
int offsetx, offsety;
double angle;
enum MS_POSITIONS_ENUM anglemode;
int buffer; /* space to reserve around a label */
int align;
char wrap;
int maxlength;
int minlength;
double space_size_10; /*cached size of a single space character used for label text alignment of rfc40 */
int minfeaturesize; /* minimum feature size (in pixels) to label */
int autominfeaturesize; /* true or false */
double minscaledenom, maxscaledenom;
int mindistance;
int repeatdistance;
double maxoverlapangle;
int partials; /* can labels run of an image */
int force; /* labels *must* be drawn */
char *encoding;
int priority; /* Priority level 1 to MS_MAX_LABEL_PRIORITY, default=1 */
int numstyles;
labelLeaderObj *leader;
};
typedef struct labelObj labelObj;
%constant MS_LABEL_PERPENDICULAR_OFFSET = -99;
%constant MS_LABEL_PERPENDICULAR_TOP_OFFSET = 99;
/************************************************************************/
/* classObj */
/* */
/* basic symbolization and classification information */
/************************************************************************/
struct classObj {
int status;
%feature("immutable");
int numstyles;
%feature("immutable","");
int numlabels; /* should be immutable */
char *name; /* should be unique within a layer */
char *title; /* used for legend labeling */
char *template;
%feature("immutable");
hashTableObj metadata;
hashTableObj validation;
%feature("immutable","");
double minscaledenom, maxscaledenom;
int minfeaturesize; /* minimum feature size (in pixels) to shape */
%feature("immutable");
int refcount;
struct layerObj *layer;
%feature("immutable","");
int debug;
char *keyimage;
char *group;
labelLeaderObj *leader;
};
/************************************************************************/
/* labelCacheMemberObj */
/* */
/* structures to implement label caching and collision */
/* avoidance etc */
/* */
/* Note: These are scriptable, but are read only. */
/************************************************************************/
%feature("immutable");
typedef struct {
textSymbolObj **textsymbols;
int numtextsymbols;
int layerindex; /* indexes */
int classindex;
pointObj point; /* label point */
rectObj bbox; /* bounds of the whole cachePtr. Individual text and symbol sub bounds are found in the textsymbols */
int status; /* has this label been drawn or not */
int markerid; /* corresponding marker (POINT layers only) */
lineObj *leaderline;
rectObj *leaderbbox;
} labelCacheMemberObj;
/************************************************************************/
/* markerCacheMemberObj */
/************************************************************************/
typedef struct {
int id; /* corresponding label */
rectObj bounds;
} markerCacheMemberObj;
/************************************************************************/
/* labelCacheSlotObj */
/************************************************************************/
typedef struct {
labelCacheMemberObj *labels;
int numlabels;
int cachesize;
markerCacheMemberObj *markers;
int nummarkers;
int markercachesize;
} labelCacheSlotObj;
/************************************************************************/
/* labelCacheObj */
/************************************************************************/
typedef struct {
/* One labelCacheSlotObj for each priority level */
labelCacheSlotObj slots[10];
int gutter; /* space in pixels around the image where labels cannot be placed */
labelCacheMemberObj **rendered_text_symbols;
int num_allocated_rendered_members;
int num_rendered_members;
} labelCacheObj;
/************************************************************************/
/* resultObj */
/************************************************************************/
typedef struct {
long shapeindex;
int tileindex;
int resultindex;
int classindex;
} resultObj;
%feature("immutable","");
/************************************************************************/
/* resultCacheObj */
/************************************************************************/
typedef struct {
%feature("immutable");
int numresults;
rectObj bounds;
%feature("immutable","");
/* TODO: remove for 6.0, confirm with Assefa */
/*used to force the result retreiving to use getshape instead of resultgetshape*/
int usegetshape;
} resultCacheObj;
/************************************************************************/
/* symbolSetObj */
/************************************************************************/
typedef struct {
char *filename;
int imagecachesize;
%feature("immutable");
int numsymbols;
int maxsymbols;
%feature("immutable","");
} symbolSetObj;
/************************************************************************/
/* referenceMapObj */
/************************************************************************/
typedef struct {
rectObj extent;
int height, width;
colorObj color;
colorObj outlinecolor;
char *image;
int status;
int marker;
char *markername;
int markersize;
int minboxsize;
int maxboxsize;
%feature("immutable");
struct mapObj *map;
%feature("immutable","");
} referenceMapObj;
/************************************************************************/
/* scalebarObj */
/************************************************************************/
typedef struct {
colorObj imagecolor;
int height, width;
int style;
int intervals;
labelObj label;
colorObj color;
colorObj backgroundcolor;
colorObj outlinecolor;
int units;
int status; /* ON, OFF or EMBED */
int position; /* for embeded scalebars */
int postlabelcache;
int align;
int offsetx;
int offsety;
} scalebarObj;
/************************************************************************/
/* legendObj */
/************************************************************************/
typedef struct {
colorObj imagecolor;
%feature("immutable");
labelObj label;
%feature("immutable","");
int keysizex, keysizey;
int keyspacingx, keyspacingy;
colorObj outlinecolor; /* Color of outline of box, -1 for no outline */
int status; /* ON, OFF or EMBED */
int height, width;
int position; /* for embeded legends */
int postlabelcache;
char *template;
%feature("immutable");
struct mapObj *map;
%feature("immutable","");
} legendObj;
/************************************************************************/
/* graticuleObj */
/************************************************************************/
/************************************************************************/
/* imageObj */
/* */
/* A wrapper for GD and other images. */
/************************************************************************/
struct imageObj{
%feature("immutable");
int width, height;
double resolution;
double resolutionfactor;
char *imagepath, *imageurl;
outputFormatObj *format;
%feature("immutable","");
};
/************************************************************************/
/* layerObj */
/* */
/* base unit of a map. */
/************************************************************************/
typedef struct {
double minscale;
double maxscale;
char *value;
} scaleTokenEntryObj;
typedef struct {
char *name;
int n_entries;
scaleTokenEntryObj *tokens;
} scaleTokenObj;
struct layerObj {
char *classitem; /* .DBF item to be used for symbol lookup */
%feature("immutable");
/* reference counting, RFC24 */
int refcount;
int numclasses;
int maxclasses;
int index;
struct mapObj *map;
%feature("immutable","");
char *header, *footer; /* only used with multi result queries */
char *template; /* global template, used across all classes */
char *name; /* should be unique */
char *group; /* shouldn't be unique it's supposed to be a group right? */
int status; /* on or off */
char *data; /* filename, can be relative or full path */
enum MS_LAYER_TYPE type;
double tolerance; /* search buffer for point and line queries (in toleranceunits) */
int toleranceunits;
double symbolscaledenom; /* scale at which symbols are default size */
double minscaledenom, maxscaledenom;
int minfeaturesize; /* minimum feature size (in pixels) to shape */
double labelminscaledenom, labelmaxscaledenom;
double mingeowidth, maxgeowidth; /* map width (in map units) at which the layer should be drawn */
int sizeunits; /* applies to all classes */
int maxfeatures;
int startindex;
colorObj offsite; /* transparent pixel value for raster images */
int transform; /* does this layer have to be transformed to file coordinates */
int labelcache, postlabelcache; /* on or off */
char *labelitem;
char *tileitem;
char *tileindex; /* layer index file for tiling support */
char *tilesrs;
int units; /* units of the projection */
char *connection;
char *plugin_library;
char *plugin_library_original; /* this is needed for mapfile writing */
enum MS_CONNECTION_TYPE connectiontype;
/* attribute/classification handling components */
%feature("immutable");
int numitems;
%feature("immutable","");
char *bandsitem; /* which item in a tile contains bands to use (tiled raster data only) */
char *filteritem;
char *styleitem; /* item to be used for style lookup - can also be 'AUTO' */
char *requires; /* context expressions, simple enough to not use expressionObj */
char *labelrequires;
%feature("immutable");
hashTableObj metadata;
hashTableObj validation;
hashTableObj bindvals;
clusterObj cluster;
%feature("immutable","");
int dump;
int debug;
%feature("immutable");
rectObj extent;
int numprocessing;
int numjoins;
%feature("immutable","");
char *classgroup;
char *mask;
char *encoding; /* for iconving shape attributes. ignored if NULL or "utf-8" */
/* RFC93 UTFGrid support */
char *utfitem;
int utfitemindex;
expressionObj utfdata;
LayerCompositer *compositer;
};
/************************************************************************/
/* mapObj */
/* */
/* encompasses everything used in an Internet mapping */
/* application. */
/************************************************************************/
/* MAP OBJECT - */
struct mapObj { /* structure for a map */
char *name; /* small identifier for naming etc. */
int status; /* is map creation on or off */
int height, width;
int maxsize;
%feature("immutable");
/* reference counting, RFC24 */
int refcount;
int numlayers; /* number of layers in mapfile */
int maxlayers; /* allocated size of layers[] array */
symbolSetObj symbolset;
fontSetObj fontset;
labelCacheObj labelcache; /* we need this here so multiple feature processors can access it */
%feature("immutable","");
int transparent; /* TODO - Deprecated */
int interlace; /* TODO - Deprecated */
int imagequality; /* TODO - Deprecated */
rectObj extent; /* map extent array */
double cellsize; /* in map units */
enum MS_UNITS units; /* units of the projection */
double scaledenom; /* scale of the output image */
double resolution;
double defresolution; /* default resolution: used for calculate the scalefactor */
char *shapepath; /* where are the shape files located */
char *mappath; /* path of the mapfile, all path are relative to this path */
colorObj imagecolor; /* holds the initial image color value */
%feature("immutable");
int numoutputformats;
outputFormatObj *outputformat;
char *imagetype; /* name of current outputformat */
%feature("immutable","");
%feature("immutable");
referenceMapObj reference;
scalebarObj scalebar;
legendObj legend;
queryMapObj querymap;
webObj web;
%feature("immutable","");
int *layerorder;
int debug;
char *datapattern, *templatepattern; /* depricated, use VALIDATION ... END block instead */
%feature("immutable");
hashTableObj configoptions;
%feature("immutable","");
};
/************************************************************************/
/* layerVTable */
/* */
/* contains function pointers to the layer operations. If you */
/* add new functions to here, remember to update */
/* populateVirtualTable in maplayer.c */
/************************************************************************/
/* Function prototypes, wrapable */
int msSaveImage(mapObj *map, imageObj *img, const char *filename);
void msFreeImage(imageObj *img);
int msSetup(void);
void msCleanup(void);
mapObj *msLoadMapFromString(char *buffer, char *new_mappath);
/* Function prototypes, not wrapable */
%endoffile
%includefile "../../mapprimitive.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Declarations for rectObj, pointObj, lineObj, shapeObj, etc.
* Author: Steve Lime and the MapServer team.
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
/* feature primitives */
typedef struct {
double minx, miny, maxx, maxy;
} rectObj;
typedef struct {
double x;
double y;
} pointObj;
typedef struct {
%feature("immutable");
int numpoints;
%feature("immutable","");
} lineObj;
typedef struct {
%feature("immutable");
int numlines;
int numvalues;
%feature("immutable","");
rectObj bounds;
int type; /* MS_SHAPE_TYPE */
long index;
int tileindex;
int classindex;
char *text;
int scratch;
int resultindex; /* index within a query result set */
} shapeObj;
typedef lineObj multipointObj;
%endoffile
%includefile "../../mapshape.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Shapefile access API
* Author: Steve Lime and the MapServer team.
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
%constant SHX_BUFFER_PAGE = 1024;
%constant MS_SHAPEFILE_POINT = 1;
%constant MS_SHAPEFILE_ARC = 3;
%constant MS_SHAPEFILE_POLYGON = 5;
%constant MS_SHAPEFILE_MULTIPOINT = 8;
%constant MS_SHP_POINTZ = 11;
%constant MS_SHP_ARCZ = 13;
%constant MS_SHP_POLYGONZ = 15;
%constant MS_SHP_MULTIPOINTZ = 18;
%constant MS_SHP_POINTM = 21;
%constant MS_SHP_ARCM = 23;
%constant MS_SHP_POLYGONM = 25;
%constant MS_SHP_MULTIPOINTM = 28;
typedef struct {
%feature("immutable");
FILE *fp;
int nRecords;
unsigned int nRecordLength;
int nHeaderLength;
int nFields;
int *panFieldOffset;
int *panFieldSize;
int *panFieldDecimals;
char *pachFieldType;
char *pszHeader;
int nCurrentRecord;
int bCurrentRecordModified;
char *pszCurrentRecord;
int bNoHeader;
int bUpdated;
char *pszStringField;
int nStringFieldLen;
%feature("immutable","");
} DBFInfo;
typedef DBFInfo * DBFHandle;
typedef enum {FTString, FTInteger, FTDouble, FTInvalid} DBFFieldType;
/* Shapefile object, no write access via scripts */
typedef struct {
%feature("immutable");
char source[MS_PATH_LENGTH]; /* full path to this file data */
int type; /* shapefile type */
int numshapes; /* number of shapes */
rectObj bounds; /* shape extent */
int lastshape;
ms_bitarray status;
int isopen;
%feature("immutable","");
} shapefileObj;
%endoffile
%includefile "../../mapproject.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Declarations of the projectionObj and related functions.
* Author: Steve Lime and the MapServer team.
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
/* workaround to allow compiling against Proj 6.x (#5766) */
%constant ACCEPT_USE_OF_DEPRECATED_PROJ_API_H = 1;
%constant wkp_none = 0;
%constant wkp_lonlat = 1;
%constant wkp_gmerc = 2;
typedef struct {
%feature("immutable");
int numargs; /* actual number of projection args */
int automatic; /* projection object was to fetched from the layer */
%feature("immutable","");
int wellknownprojection;
} projectionObj;
%endoffile
%includefile "../../mapsymbol.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: symbolObj related declarations.
* Author: Steve Lime and the MapServer team.
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
enum MS_SYMBOL_TYPE {MS_SYMBOL_SIMPLE=1000, MS_SYMBOL_VECTOR, MS_SYMBOL_ELLIPSE, MS_SYMBOL_PIXMAP, MS_SYMBOL_TRUETYPE, MS_SYMBOL_HATCH, MS_SYMBOL_SVG};
%constant MS_SYMBOL_ALLOCSIZE = 64; /* number of symbolObj ptrs to allocate for a symbolset at once */
%constant MS_MAXVECTORPOINTS = 100; /* shade, marker and line symbol parameters */
%constant MS_MAXPATTERNLENGTH = 10;
%constant MS_IMAGECACHESIZE = 6;
/* COLOR OBJECT */
typedef struct {
int red;
int green;
int blue;
int alpha;
} colorObj;
struct symbolObj{
char *name;
int type;
int inmapfile; /* boolean value for writing */
/*
** MS_SYMBOL_VECTOR and MS_SYMBOL_ELLIPSE options
*/
double sizex, sizey;
double minx,miny,maxx,maxy;
%feature("immutable");
int refcount;
int numpoints;
%feature("immutable","");
int filled;
double anchorpoint_x, anchorpoint_y;
/*
** MS_SYMBOL_PIXMAP options
*/
%feature("immutable");
char *imagepath;
%feature("immutable","");
int transparent;
int transparentcolor;
/*
** MS_SYMBOL_TRUETYPE options
*/
char *character;
char *font;
} ;
%endoffile
%apply Pointer NONNULL { mapObj *map };
%apply Pointer NONNULL { layerObj *layer };
/*
=============================================================================
Class extension methods are now included from separate interface files
=============================================================================
*/
%includefile "../swiginc/error.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript errorObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
/* wrap the errorObj and a few functions */
%includefile "../../maperror.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Declarations for Error and Debug functions.
* Author: Steve Lime and the MapServer team.
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
/*====================================================================
* maperror.c
*====================================================================*/
%constant MS_NOERR = 0; /* general error codes */
%constant MS_IOERR = 1;
%constant MS_MEMERR = 2;
%constant MS_TYPEERR = 3;
%constant MS_SYMERR = 4;
%constant MS_REGEXERR = 5;
%constant MS_TTFERR = 6;
%constant MS_DBFERR = 7;
%constant MS_IDENTERR = 9;
%constant MS_EOFERR = 10;
%constant MS_PROJERR = 11;
%constant MS_MISCERR = 12;
%constant MS_CGIERR = 13;
%constant MS_WEBERR = 14;
%constant MS_IMGERR = 15;
%constant MS_HASHERR = 16;
%constant MS_JOINERR = 17;
%constant MS_NOTFOUND = 18; /* empty search results */
%constant MS_SHPERR = 19;
%constant MS_PARSEERR = 20;
%constant MS_UNUSEDERR = 21;
%constant MS_OGRERR = 22;
%constant MS_QUERYERR = 23;
%constant MS_WMSERR = 24; /* WMS server error */
%constant MS_WMSCONNERR = 25; /* WMS connectiontype error */
%constant MS_ORACLESPATIALERR = 26;
%constant MS_WFSERR = 27; /* WFS server error */
%constant MS_WFSCONNERR = 28; /* WFS connectiontype error */
%constant MS_MAPCONTEXTERR = 29; /* Map Context error */
%constant MS_HTTPERR = 30;
%constant MS_CHILDERR = 31; /* Errors involving arrays of child objects */
%constant MS_WCSERR = 32;
%constant MS_GEOSERR = 33;
%constant MS_RECTERR = 34;
%constant MS_TIMEERR = 35;
%constant MS_GMLERR = 36;
%constant MS_SOSERR = 37;
%constant MS_NULLPARENTERR = 38;
%constant MS_AGGERR = 39;
%constant MS_OWSERR = 40;
%constant MS_OGLERR = 41;
%constant MS_RENDERERERR = 42;
%constant MS_V8ERR = 43;
%constant MS_NUMERRORCODES = 44;
%constant MESSAGELENGTH = 2048;
%constant ROUTINELENGTH = 64;
%constant MS_ERROR_LANGUAGE = "en-US";
typedef struct errorObj {
int code;
char routine[64];
char message[2048];
int isreported;
int errorcount; /* number of subsequent errors */
} errorObj;
/*
** Function prototypes
*/
errorObj *msGetErrorObj(void);
void msResetErrorList(void);
char *msGetVersion(void);
int msGetVersionInt(void);
char *msGetErrorString(char *delimiter);
/*====================================================================
* mapdebug.c (See also MS-RFC-28)
*====================================================================*/
typedef enum { MS_DEBUGLEVEL_ERRORSONLY = 0, /* DEBUG OFF, log fatal errors */
MS_DEBUGLEVEL_DEBUG = 1, /* DEBUG ON */
MS_DEBUGLEVEL_TUNING = 2, /* Reports timing info */
MS_DEBUGLEVEL_V = 3, /* Verbose */
MS_DEBUGLEVEL_VV = 4, /* Very verbose */
MS_DEBUGLEVEL_VVV = 5, /* Very very verbose */
MS_DEBUGLEVEL_DEVDEBUG = 20, /* Undocumented, will trigger debug messages only useful for developers */
} debugLevel;
%endoffile
/* A few things neccessary for automatically wrapped functions */
%feature("new") msGetErrorString;
%extend errorObj
{
errorObj()
{
return msGetErrorObj();
}
~errorObj() {}
errorObj *next()
{
errorObj *ep;
if (self == NULL || self->next == NULL) return NULL;
ep = msGetErrorObj();
while (ep != self) {
/* We reached end of list of active errorObj and
didn't find the errorObj... this is bad! */
if (ep->next == NULL) return NULL;
ep = ep->next;
}
return ep->next;
}
}
%endoffile
%includefile "../swiginc/map.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript mapObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend mapObj
{
mapObj(char *filename="")
{
if (filename && strlen(filename))
return msLoadMap(filename, NULL);
else { /* create an empty map, no layers etc... */
return msNewMapObj();
}
}
~mapObj()
{
msFreeMap(self);
}
%feature("new") clone;
mapObj *clone()
{
mapObj *dstMap;
dstMap = msNewMapObj();
if (msCopyMap(dstMap, self) != MS_SUCCESS) {
msFreeMap(dstMap);
dstMap = NULL;
}
return dstMap;
}
int insertLayer(layerObj *layer, int index=-1)
{
return msInsertLayer(self, layer, index);
}
%feature("new") removeLayer;
layerObj *removeLayer(int index)
{
layerObj *layer=msRemoveLayer(self, index);
MS_REFCNT_INCR(layer);
return layer;
}
int setExtent(double minx, double miny, double maxx, double maxy) {
return msMapSetExtent( self, minx, miny, maxx, maxy );
}
int offsetExtent(double x, double y) {
return msMapOffsetExtent( self, x, y );
}
int scaleExtent(double zoomfactor,
double minscaledenom, double maxscaledenom) {
return msMapScaleExtent( self, zoomfactor, minscaledenom, maxscaledenom );
}
int setCenter(pointObj *center) {
return msMapSetCenter( self, center );
}
/* recent rotation work makes setSize the only reliable
method for changing the image size. direct access is deprecated. */
int setSize(int width, int height)
{
return msMapSetSize(self, width, height);
}
int setRotation( double rotation_angle )
{
return msMapSetRotation( self, rotation_angle );
}
%feature("new") getLayer;
layerObj *getLayer(int i) {
if(i >= 0 && i < self->numlayers) {
MS_REFCNT_INCR(self->layers[i]);
return (self->layers[i]); /* returns an EXISTING layer */
} else {
return NULL;
}
}
%feature("new") getLayerByName;
layerObj *getLayerByName(char *name) {
int i;
i = msGetLayerIndex(self, name);
if(i != -1) {
MS_REFCNT_INCR(self->layers[i]);
return (self->layers[i]); /* returns an EXISTING layer */
}
else
return NULL;
}
int getSymbolByName(char *name) {
return msGetSymbolIndex(&self->symbolset, name, 1);
}
void prepareQuery() {
int status;
status = msCalculateScale(self->extent, self->units, self->width, self->height, self->resolution, &self->scaledenom);
if(status != MS_SUCCESS) self->scaledenom = -1;
}
%feature("new") prepareImage;
imageObj *prepareImage()
{
return msPrepareImage(self, 0);
}
void setImageType( char * imagetype ) {
outputFormatObj *format;
format = msSelectOutputFormat( self, imagetype );
if( format == NULL )
msSetError(12, "Unable to find IMAGETYPE '%s'.",
"setImageType()", imagetype );
else
{
msFree( self->imagetype );
self->imagetype = msStrdup(imagetype);
msApplyOutputFormat( &(self->outputformat), format, -1111,
-1111, -1111 );
}
}
void selectOutputFormat( char *imagetype )
{
outputFormatObj *format;
format = msSelectOutputFormat( self, imagetype );
if ( format == NULL )
msSetError(12, "Unable to find IMAGETYPE '%s'.",
"setImageType()", imagetype );
else
{
msFree( self->imagetype );
self->imagetype = msStrdup(imagetype);
msApplyOutputFormat( &(self->outputformat), format, -1111,
-1111, -1111 );
}
}
%feature("new") getOutputFormat;
outputFormatObj *getOutputFormat(int i) {
if(i >= 0 && i < self->numoutputformats) {
MS_REFCNT_INCR(self->outputformatlist[i]);
return (self->outputformatlist[i]);
} else {
return NULL;
}
}
void setOutputFormat( outputFormatObj *format ) {
msApplyOutputFormat( &(self->outputformat), format, -1111,
-1111, -1111 );
}
%feature("new") draw;
imageObj *draw() {
return msDrawMap(self, 0);
}
%feature("new") drawQuery;
imageObj *drawQuery() {
return msDrawMap(self, 1);
}
%feature("new") drawLegend;
imageObj *drawLegend() {
return msDrawLegend(self, 0, NULL);
}
%feature("new") drawScalebar;
imageObj *drawScalebar() {
return msDrawScalebar(self);
}
%feature("new") drawReferenceMap;
imageObj *drawReferenceMap() {
return msDrawReferenceMap(self);
}
int embedScalebar(imageObj *image) {
return msEmbedScalebar(self, image);
}
int embedLegend(imageObj *image) {
return msEmbedLegend(self, image);
}
int drawLabelCache(imageObj *image) {
return msDrawLabelCache(self,image);
}
int queryByFilter(char *string) {
msInitQuery(&(self->query));
self->query.type = MS_QUERY_BY_FILTER;
self->query.mode = MS_QUERY_MULTIPLE;
self->query.filter.string = msStrdup(string);
self->query.filter.type = MS_EXPRESSION;
self->query.rect = self->extent;
return msQueryByFilter(self);
}
int queryByPoint(pointObj *point, int mode, double buffer) {
msInitQuery(&(self->query));
self->query.type = MS_QUERY_BY_POINT;
self->query.mode = mode;
self->query.point = *point;
self->query.buffer = buffer;
return msQueryByPoint(self);
}
int queryByRect(rectObj rect) {
msInitQuery(&(self->query));
self->query.type = MS_QUERY_BY_RECT;
self->query.mode = MS_QUERY_MULTIPLE;
self->query.rect = rect;
return msQueryByRect(self);
}
int queryByFeatures(int slayer) {
self->query.slayer = slayer;
return msQueryByFeatures(self);
}
int queryByShape(shapeObj *shape) {
msInitQuery(&(self->query));
self->query.type = MS_QUERY_BY_SHAPE;
self->query.mode = MS_QUERY_MULTIPLE;
self->query.shape = (shapeObj *) malloc(sizeof(shapeObj));
msInitShape(self->query.shape);
msCopyShape(shape, self->query.shape);
return msQueryByShape(self);
}
int setWKTProjection(char *wkt) {
return msOGCWKT2ProjectionObj(wkt, &(self->projection), self->debug);
}
%feature("new") getProjection;
char *getProjection() {
return msGetProjectionString(&(self->projection));
}
int setProjection(char *proj4) {
return msLoadProjectionString(&(self->projection), proj4);
}
int save(char *filename) {
return msSaveMap(self, filename);
}
int saveQuery(char *filename, int results=0) {
return msSaveQuery(self, filename, results);
}
int loadQuery(char *filename) {
return msLoadQuery(self, filename);
}
void freeQuery(int qlayer=-1) {
msQueryFree(self, qlayer);
}
int saveQueryAsGML(char *filename, const char *ns="GOMF") {
return msGMLWriteQuery(self, filename, ns);
}
char *getMetaData(char *name) {
char *value = NULL;
if (!name) {
msSetError(16, "NULL key", "getMetaData");
}
value = (char *) msLookupHashTable(&(self->web.metadata), name);
if (!value) {
msSetError(16, "Key %s does not exist", "getMetaData", name);
return NULL;
}
return value;
}
int setMetaData(char *name, char *value) {
if (msInsertHashTable(&(self->web.metadata), name, value) == NULL)
return MS_FAILURE;
return MS_SUCCESS;
}
int removeMetaData(char *name) {
return(msRemoveHashTable(&(self->web.metadata), name));
}
char *getFirstMetaDataKey() {
return (char *) msFirstKeyFromHashTable(&(self->web.metadata));
}
char *getNextMetaDataKey(char *lastkey) {
return (char *) msNextKeyFromHashTable(&(self->web.metadata), lastkey);
}
int setSymbolSet(char *szFileName) {
msFreeSymbolSet(&self->symbolset);
msInitSymbolSet(&self->symbolset);
self->symbolset.filename = msStrdup(szFileName);
/* Symbolset shares same fontset as main mapfile */
self->symbolset.fontset = &(self->fontset);
return msLoadSymbolSet(&self->symbolset, self);
}
int getNumSymbols() {
return self->symbolset.numsymbols;
}
int setFontSet(char *filename) {
msFreeFontSet(&(self->fontset));
msInitFontSet(&(self->fontset));
self->fontset.filename = msStrdup(filename);
return msLoadFontSet(&(self->fontset), self);
}
/* I removed a method to get the fonset filename. Instead I updated mapserver.h
to allow SWIG access to the fonset, although the numfonts and filename
members are read-only. Use the setFontSet method to actually change the
fontset. To get the filename do $map->{fontset}->{filename}; -- SG */
int saveMapContext(char *szFileName) {
return msSaveMapContext(self, szFileName);
}
int loadMapContext(char *szFileName, int useUniqueNames=0) {
return msLoadMapContext(self, szFileName, useUniqueNames);
}
int moveLayerUp(int layerindex) {
return msMoveLayerUp(self, layerindex);
}
int moveLayerDown(int layerindex) {
return msMoveLayerDown(self, layerindex);
}
%feature("new") getLayersDrawingOrder;
intarray *getLayersDrawingOrder() {
int i;
intarray *order;
order = new_intarray(self->numlayers);
for (i=0; i<self->numlayers; i++)
intarray___setitem__(order, i, self->layerorder[i]);
return order;
}
int setLayersDrawingOrder(int *panIndexes) {
return msSetLayersdrawingOrder(self, panIndexes);
}
void setConfigOption(char *key, char *value) {
msSetConfigOption(self,key,value);
}
char *getConfigOption(char *key) {
return (char *) msGetConfigOption(self,key);
}
void applyConfigOptions() {
msApplyMapConfigOptions( self );
}
/* SLD */
int applySLD(char *sld) {
return msSLDApplySLD(self, sld, -1, NULL, NULL);
}
int applySLDURL(char *sld) {
return msSLDApplySLDURL(self, sld, -1, NULL, NULL);
}
%feature("new") generateSLD;
char *generateSLD() {
return (char *) msSLDGenerateSLD(self, -1, NULL);
}
%feature("new") processTemplate;
char *processTemplate(int bGenerateImages, char **names, char **values,
int numentries)
{
return msProcessTemplate(self, bGenerateImages, names, values,
numentries);
}
%feature("new") processLegendTemplate;
char *processLegendTemplate(char **names, char **values, int numentries) {
return msProcessLegendTemplate(self, names, values, numentries);
}
%feature("new") processQueryTemplate;
char *processQueryTemplate(char **names, char **values, int numentries) {
return msProcessQueryTemplate(self, 1, names, values, numentries);
}
outputFormatObj *getOutputFormatByName(char *name) {
return msSelectOutputFormat(self, name);
}
int appendOutputFormat(outputFormatObj *format) {
return msAppendOutputFormat(self, format);
}
int removeOutputFormat(char *name) {
return msRemoveOutputFormat(self, name);
}
int loadOWSParameters(cgiRequestObj *request, char *wmtver_string="1.1.1")
{
return msMapLoadOWSParameters(self, request, wmtver_string);
}
int OWSDispatch( cgiRequestObj *req )
{
return msOWSDispatch( self, req, 1 );
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteMapToString(self);
}
}
%endoffile
%includefile "../swiginc/mapzoom.i" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Map zooming convenience methods for MapScript
* Author: Sean Gillies, sgillies@frii.com
*
******************************************************************************
*
* These functions are adapted from the code in php_mapscript.c.
*
*****************************************************************************/
%extend mapObj {
/*
-----------------------------------------------------------------------
Zoom by the given factor to a pixel position within the width
and height bounds. If max_extent is not NULL, the zoom is
constrained to the max_extents
-----------------------------------------------------------------------
*/
int zoomPoint(int zoomfactor, pointObj *poPixPos, int width, int height, rectObj *poGeorefExt, rectObj *poMaxGeorefExt)
{
double dfGeoPosX, dfGeoPosY;
double dfDeltaX, dfDeltaY;
rectObj oNewGeorefExt;
double dfNewScale;
int bMaxExtSet;
double dfDeltaExt;
double dX, dY;
dfNewScale = 0.0;
bMaxExtSet = 0;
dfDeltaExt = -1.0;
if (poMaxGeorefExt != NULL) { bMaxExtSet = 1; }
/* ----------------------------------------------------------- */
/* check the validity of the parameters. */
/* ----------------------------------------------------------- */
if (zoomfactor == 0 || width <= 0 || height <= 0 || poGeorefExt == NULL || poPixPos == NULL) {
msSetError(12, "Incorrect arguments", "mapscript::mapObj::zoomPoint()");
return MS_FAILURE;
}
/* ----------------------------------------------------------- */
/* check if the values passed are consistent min > max. */
/* ----------------------------------------------------------- */
if (poGeorefExt->minx >= poGeorefExt->maxx) {
msSetError(12, "Georeferenced coordinates minx >= maxx", "mapscript::mapObj::zoomPoint()");
return MS_FAILURE;
}
if (poGeorefExt->miny >= poGeorefExt->maxy) {
msSetError(12, "Georeferenced coordinates miny >= maxy", "mapscript::mapObj::zoomPoint()");
return MS_FAILURE;
}
if (bMaxExtSet == 1) {
if (poMaxGeorefExt->minx >= poMaxGeorefExt->maxx) {
msSetError(12, "Max Georeferenced coordinates minx >= maxx", "mapscript::mapObj::zoomPoint()");
return MS_FAILURE;
}
if (poMaxGeorefExt->miny >= poMaxGeorefExt->maxy) {
msSetError(12, "Max Georeferenced coordinates miny >= maxy", "mapscript::mapObj::zoomPoint()");
}
}
dfDeltaX = poGeorefExt->maxx - poGeorefExt->minx;
dfDeltaY = poGeorefExt->maxy - poGeorefExt->miny;
dX = dfDeltaX/((double)width);
dY = dfDeltaY/((double)height);
dfGeoPosX = poGeorefExt->minx + dX * (double)poPixPos->x;
dfGeoPosY = poGeorefExt->maxy - dY * (double)poPixPos->y;
/* --- -------------------------------------------------------- */
/* zoom in */
/* ------------------------------------------------------------ */
if (zoomfactor > 1) {
oNewGeorefExt.minx = dfGeoPosX - (dfDeltaX/(2*zoomfactor));
oNewGeorefExt.miny = dfGeoPosY - (dfDeltaY/(2*zoomfactor));
oNewGeorefExt.maxx = dfGeoPosX + (dfDeltaX/(2*zoomfactor));
oNewGeorefExt.maxy = dfGeoPosY + (dfDeltaY/(2*zoomfactor));
}
if (zoomfactor < 0) {
oNewGeorefExt.minx = dfGeoPosX - (dfDeltaX/2)*(abs(zoomfactor));
oNewGeorefExt.miny = dfGeoPosY - (dfDeltaY/2)*(abs(zoomfactor));
oNewGeorefExt.maxx = dfGeoPosX + (dfDeltaX/2)*(abs(zoomfactor));
oNewGeorefExt.maxy = dfGeoPosY + (dfDeltaY/2)*(abs(zoomfactor));
}
if (zoomfactor == 1) {
oNewGeorefExt.minx = dfGeoPosX - (dfDeltaX/2);
oNewGeorefExt.miny = dfGeoPosY - (dfDeltaY/2);
oNewGeorefExt.maxx = dfGeoPosX + (dfDeltaX/2);
oNewGeorefExt.maxy = dfGeoPosY + (dfDeltaY/2);
}
/* ------------------------------------------------------------ */
/* if the min and max scale are set in the map file, we will */
/* use them to test before zooming. */
/* ------------------------------------------------------------ */
msAdjustExtent(&oNewGeorefExt, self->width, self->height);
msCalculateScale(oNewGeorefExt, self->units, self->width, self->height, self->resolution, &dfNewScale);
if (self->web.maxscaledenom > 0) {
if (zoomfactor < 0 && dfNewScale > self->web.maxscaledenom) {
return MS_FAILURE;
}
}
/* ============================================================ */
/* we do a spcial case for zoom in : we try to zoom as much as */
/* possible using the mincale set in the .map. */
/* ============================================================ */
if (self->web.minscaledenom > 0 && dfNewScale < self->web.minscaledenom && zoomfactor > 1) {
/* To be consistent in swig mapscript and PHP mapscript,
use the same function to calculate the delta extents. */
dfDeltaExt = GetDeltaExtentsUsingScale(self->web.minscaledenom, self->units, dfGeoPosY,
self->width, self->resolution);
if (dfDeltaExt > 0.0) {
oNewGeorefExt.minx = dfGeoPosX - (dfDeltaExt/2);
oNewGeorefExt.miny = dfGeoPosY - (dfDeltaExt/2);
oNewGeorefExt.maxx = dfGeoPosX + (dfDeltaExt/2);
oNewGeorefExt.maxy = dfGeoPosY + (dfDeltaExt/2);
} else
return MS_FAILURE;
}
/* ------------------------------------------------------------ */
/* If the buffer is set, make sure that the extents do not go */
/* beyond the buffer. */
/* ------------------------------------------------------------ */
if (bMaxExtSet) {
dfDeltaX = oNewGeorefExt.maxx - oNewGeorefExt.minx;
dfDeltaY = oNewGeorefExt.maxy - oNewGeorefExt.miny;
/* Make sure Current georef extents is not bigger than
* max extents */
if (dfDeltaX > (poMaxGeorefExt->maxx-poMaxGeorefExt->minx))
dfDeltaX = poMaxGeorefExt->maxx-poMaxGeorefExt->minx;
if (dfDeltaY > (poMaxGeorefExt->maxy-poMaxGeorefExt->miny))
dfDeltaY = poMaxGeorefExt->maxy-poMaxGeorefExt->miny;
if (oNewGeorefExt.minx < poMaxGeorefExt->minx) {
oNewGeorefExt.minx = poMaxGeorefExt->minx;
oNewGeorefExt.maxx = oNewGeorefExt.minx + dfDeltaX;
}
if (oNewGeorefExt.maxx > poMaxGeorefExt->maxx) {
oNewGeorefExt.maxx = poMaxGeorefExt->maxx;
oNewGeorefExt.minx = oNewGeorefExt.maxx - dfDeltaX;
}
if (oNewGeorefExt.miny < poMaxGeorefExt->miny) {
oNewGeorefExt.miny = poMaxGeorefExt->miny;
oNewGeorefExt.maxy = oNewGeorefExt.miny + dfDeltaY;
}
if (oNewGeorefExt.maxy > poMaxGeorefExt->maxy) {
oNewGeorefExt.maxy = poMaxGeorefExt->maxy;
oNewGeorefExt.miny = oNewGeorefExt.maxy - dfDeltaY;
}
}
/* ------------------------------------------------------------ */
/* set the map extents with new values. */
/* ------------------------------------------------------------ */
self->extent.minx = oNewGeorefExt.minx;
self->extent.miny = oNewGeorefExt.miny;
self->extent.maxx = oNewGeorefExt.maxx;
self->extent.maxy = oNewGeorefExt.maxy;
self->cellsize = msAdjustExtent(&(self->extent), self->width, self->height);
dfDeltaX = self->extent.maxx - self->extent.minx;
dfDeltaY = self->extent.maxy - self->extent.miny;
if (bMaxExtSet) {
if (self->extent.minx < poMaxGeorefExt->minx) {
self->extent.minx = poMaxGeorefExt->minx;
self->extent.maxx = self->extent.minx + dfDeltaX;
}
if (self->extent.maxx > poMaxGeorefExt->maxx) {
self->extent.maxx = poMaxGeorefExt->maxx;
oNewGeorefExt.minx = oNewGeorefExt.maxx - dfDeltaX;
}
if (self->extent.miny < poMaxGeorefExt->miny) {
self->extent.miny = poMaxGeorefExt->miny;
self->extent.maxy = self->extent.miny + dfDeltaY;
}
if (self->extent.maxy > poMaxGeorefExt->maxy) {
self->extent.maxy = poMaxGeorefExt->maxy;
oNewGeorefExt.miny = oNewGeorefExt.maxy - dfDeltaY;
}
}
msCalculateScale(self->extent, self->units, self->width, self->height, self->resolution, &(self->scaledenom));
return MS_SUCCESS;
}
int zoomRectangle(rectObj *poPixRect, int width, int height, rectObj *poGeorefExt, rectObj *poMaxGeorefExt)
{
double dfDeltaX, dfDeltaY;
rectObj oNewGeorefExt;
double dfNewScale;
double dfDeltaExt;
double dfMiddleX, dfMiddleY;
int bMaxExtSet;
bMaxExtSet = 0;
dfNewScale = 0.0;
dfDeltaExt = -1.0;
if (poMaxGeorefExt != NULL) bMaxExtSet = 1;
/* ----------------------------------------------------------- */
/* check the validity of the parameters. */
/* ----------------------------------------------------------- */
if (poPixRect == 0 || width <= 0 || height <= 0 || poGeorefExt == NULL) {
msSetError(12, "Incorrect arguments", "mapscript::mapObj::zoomRectangle");
return MS_FAILURE;
}
/* ----------------------------------------------------------- */
/* check if the values passed are consistent min <= max. */
/* ----------------------------------------------------------- */
if (poPixRect->minx >= poPixRect->maxx) {
msSetError(12, "image rectangle minx >= maxx", "mapscript::mapObj::zoomRectangle()");
return MS_FAILURE;
}
/* This is not a typo: "maxx >= minx". For historical reason, we
* keep this as it is. See documentation for more info about this check. */
if (poPixRect->maxy >= poPixRect->miny) {
msSetError(12, "image rectangle maxy >= miny", "mapscript::mapObj::zoomRectangle()");
return MS_FAILURE;
}
if (poGeorefExt->minx >= poGeorefExt->maxx) {
msSetError(12, "Georeferenced coordinates minx >= maxx", "mapscript::mapObj::zoomRectangle()");
return MS_FAILURE;
}
if (poGeorefExt->miny >= poGeorefExt->maxy) {
msSetError(12, "Georeferenced coordinates miny >= maxy", "mapscript::mapObj::zoomRectangle()");
return MS_FAILURE;
}
if (bMaxExtSet == 1) {
if (poMaxGeorefExt->minx >= poMaxGeorefExt->maxx) {
msSetError(12, "Max Georeferenced coordinates minx >= maxx", "mapscript::mapObj::zoomRectangle()");
return MS_FAILURE;
}
if (poMaxGeorefExt->miny >= poMaxGeorefExt->maxy) {
msSetError(12, "Max Georeferenced coordinates miny >= maxy", "mapscript::mapObj::zoomRectangle()");
return MS_FAILURE;
}
}
/* ----------------------------------------------------------- */
/* Convert pixel rectangle to georeferenced rectangle */
/* ----------------------------------------------------------- */
dfDeltaX = poGeorefExt->maxx - poGeorefExt->minx;
dfDeltaY = poGeorefExt->maxy - poGeorefExt->miny;
oNewGeorefExt.minx = Pix2Georef((int)poPixRect->minx, 0, width, poGeorefExt->minx, poGeorefExt->maxx, 0);
oNewGeorefExt.maxx = Pix2Georef((int)poPixRect->maxx, 0, width, poGeorefExt->minx, poGeorefExt->maxx, 0);
oNewGeorefExt.miny = Pix2Georef((int)poPixRect->miny, 0, height, poGeorefExt->miny, poGeorefExt->maxy, 1);
oNewGeorefExt.maxy = Pix2Georef((int)poPixRect->maxy, 0, height, poGeorefExt->miny, poGeorefExt->maxy, 1);
msAdjustExtent(&oNewGeorefExt, self->width, self->height);
/* ------------------------------------------------------------ */
/* if the min and max scale are set in the map file, we will */
/* use them to test before setting extents. */
/* ------------------------------------------------------------ */
msCalculateScale(oNewGeorefExt, self->units, self->width, self->height, self->resolution, &dfNewScale);
if (self->web.maxscaledenom > 0 && dfNewScale > self->web.maxscaledenom)
return MS_FAILURE;
if (self->web.minscaledenom > 0 && dfNewScale < self->web.minscaledenom) {
dfMiddleX = oNewGeorefExt.minx + ((oNewGeorefExt.maxx - oNewGeorefExt.minx)/2);
dfMiddleY = oNewGeorefExt.miny + ((oNewGeorefExt.maxy - oNewGeorefExt.miny)/2);
/* To be consistent in swig mapscript and PHP mapscript,
use the same function to calculate the delta extents. */
dfDeltaExt = GetDeltaExtentsUsingScale(self->web.minscaledenom, self->units, dfMiddleY, self->width, self->resolution);
if (dfDeltaExt > 0.0) {
oNewGeorefExt.minx = dfMiddleX - (dfDeltaExt/2);
oNewGeorefExt.miny = dfMiddleY - (dfDeltaExt/2);
oNewGeorefExt.maxx = dfMiddleX + (dfDeltaExt/2);
oNewGeorefExt.maxy = dfMiddleY + (dfDeltaExt/2);
} else
return MS_FAILURE;
}
/* ------------------------------------------------------------ */
/* If the buffer is set, make sure that the extents do not go */
/* beyond the buffer. */
/* ------------------------------------------------------------ */
if (bMaxExtSet) {
dfDeltaX = oNewGeorefExt.maxx - oNewGeorefExt.minx;
dfDeltaY = oNewGeorefExt.maxy - oNewGeorefExt.miny;
/* Make sure Current georef extents is not bigger
* than max extents */
if (dfDeltaX > (poMaxGeorefExt->maxx-poMaxGeorefExt->minx))
dfDeltaX = poMaxGeorefExt->maxx-poMaxGeorefExt->minx;
if (dfDeltaY > (poMaxGeorefExt->maxy-poMaxGeorefExt->miny))
dfDeltaY = poMaxGeorefExt->maxy-poMaxGeorefExt->miny;
if (oNewGeorefExt.minx < poMaxGeorefExt->minx) {
oNewGeorefExt.minx = poMaxGeorefExt->minx;
oNewGeorefExt.maxx = oNewGeorefExt.minx + dfDeltaX;
}
if (oNewGeorefExt.maxx > poMaxGeorefExt->maxx) {
oNewGeorefExt.maxx = poMaxGeorefExt->maxx;
oNewGeorefExt.minx = oNewGeorefExt.maxx - dfDeltaX;
}
if (oNewGeorefExt.miny < poMaxGeorefExt->miny) {
oNewGeorefExt.miny = poMaxGeorefExt->miny;
oNewGeorefExt.maxy = oNewGeorefExt.miny + dfDeltaY;
}
if (oNewGeorefExt.maxy > poMaxGeorefExt->maxy) {
oNewGeorefExt.maxy = poMaxGeorefExt->maxy;
oNewGeorefExt.miny = oNewGeorefExt.maxy - dfDeltaY;
}
}
self->extent.minx = oNewGeorefExt.minx;
self->extent.miny = oNewGeorefExt.miny;
self->extent.maxx = oNewGeorefExt.maxx;
self->extent.maxy = oNewGeorefExt.maxy;
self->cellsize = msAdjustExtent(&(self->extent), self->width, self->height);
dfDeltaX = self->extent.maxx - self->extent.minx;
dfDeltaY = self->extent.maxy - self->extent.miny;
if (bMaxExtSet) {
if (self->extent.minx < poMaxGeorefExt->minx) {
self->extent.minx = poMaxGeorefExt->minx;
self->extent.maxx = self->extent.minx + dfDeltaX;
}
if (self->extent.maxx > poMaxGeorefExt->maxx) {
self->extent.maxx = poMaxGeorefExt->maxx;
oNewGeorefExt.minx = oNewGeorefExt.maxx - dfDeltaX;
}
if (self->extent.miny < poMaxGeorefExt->miny) {
self->extent.miny = poMaxGeorefExt->miny;
self->extent.maxy = self->extent.miny + dfDeltaY;
}
if (self->extent.maxy > poMaxGeorefExt->maxy) {
self->extent.maxy = poMaxGeorefExt->maxy;
oNewGeorefExt.miny = oNewGeorefExt.maxy - dfDeltaY;
}
}
msCalculateScale(self->extent, self->units, self->width, self->height, self->resolution, &(self->scaledenom));
return MS_SUCCESS;
}
/*
-------------------------------------------------------------------
Zoom by the given factor to a pixel position within the width
and height bounds. If max_extent is not NULL, the zoom is
constrained to the max_extents
-------------------------------------------------------------------
*/
int zoomScale(double scale, pointObj *poPixPos, int width, int height,
rectObj *poGeorefExt, rectObj *poMaxGeorefExt)
{
double dfGeoPosX, dfGeoPosY;
double dfDeltaX, dfDeltaY;
rectObj oNewGeorefExt;
double dfNewScale, dfCurrentScale;
int bMaxExtSet;
int nTmp;
double dfDeltaExt;
double dX, dY;
dfNewScale = 0.0;
dfCurrentScale = 0.0;
nTmp = 0;
bMaxExtSet = 0;
dfDeltaExt = -1.0;
if (poMaxGeorefExt != NULL) { bMaxExtSet = 1; }
/* ----------------------------------------------------------- */
/* check the validity of the parameters. */
/* ----------------------------------------------------------- */
if (scale <= 0.0 || width <= 0 || height <= 0 || poGeorefExt == NULL || poPixPos == NULL ) {
msSetError(12, "Incorrect arguments", "mapscript::mapObj::zoomScale");
return MS_FAILURE;
}
/* ----------------------------------------------------------- */
/* check if the values passed are consistent min > max. */
/* ----------------------------------------------------------- */
if (poGeorefExt->minx >= poGeorefExt->maxx) {
msSetError(12, "Georeferenced coordinates minx >= maxx", "mapscript::mapObj::zoomScale()");
return MS_FAILURE;
}
if (poGeorefExt->miny >= poGeorefExt->maxy) {
msSetError(12, "Georeferenced coordinates miny >= maxy", "mapscript::mapObj::zoomScale()");
return MS_FAILURE;
}
if (bMaxExtSet == 1) {
if (poMaxGeorefExt->minx >= poMaxGeorefExt->maxx) {
msSetError(12, "Max Georeferenced coordinates minx >= maxx", "mapscript::mapObj::zoomScale()");
return MS_FAILURE;
}
if (poMaxGeorefExt->miny >= poMaxGeorefExt->maxy) {
msSetError(12, "Max Georeferenced coordinates miny >= maxy", "mapscript::mapObj::zoomScale()");
}
}
dfDeltaX = poGeorefExt->maxx - poGeorefExt->minx;
dfDeltaY = poGeorefExt->maxy - poGeorefExt->miny;
dX = dfDeltaX/((double)width);
dY = dfDeltaY/((double)height);
dfGeoPosX = poGeorefExt->minx + dX * (double)poPixPos->x;
dfGeoPosY = poGeorefExt->maxy - dY * (double)poPixPos->y;
/* ------------------------------------------------------------ */
/* Calculate new extents based on the scale. */
/* ------------------------------------------------------------ */
/* ============================================================ */
/* make sure to take the smallest size because this is the one */
/* that will be used to ajust the scale. */
/* ============================================================ */
if (self->width < self->height)
nTmp = self->width;
else
nTmp = self->height;
/* To be consistent in swig mapscript and PHP mapscript,
use the same function to calculate the delta extents. */
dfDeltaExt = GetDeltaExtentsUsingScale(scale, self->units, dfGeoPosY, nTmp, self->resolution);
if (dfDeltaExt > 0.0) {
oNewGeorefExt.minx = dfGeoPosX - (dfDeltaExt/2);
oNewGeorefExt.miny = dfGeoPosY - (dfDeltaExt/2);
oNewGeorefExt.maxx = dfGeoPosX + (dfDeltaExt/2);
oNewGeorefExt.maxy = dfGeoPosY + (dfDeltaExt/2);
} else
return MS_FAILURE;
/* ------------------------------------------------------------ */
/* get current scale. */
/* ------------------------------------------------------------ */
msCalculateScale(*poGeorefExt, self->units, self->width, self->height, self->resolution, &dfCurrentScale);
/* ------------------------------------------------------------ *
* if the min and max scale are set in the map file, we will *
* use them to test before zooming. *
* *
* This function has the same effect as zoomin or zoom out.
* If the current scale is > newscale we zoom in; else it is
* a zoom out.
* ------------------------------------------------------------ */
msAdjustExtent(&oNewGeorefExt, self->width, self->height);
msCalculateScale(oNewGeorefExt, self->units, self->width, self->height, self->resolution, &dfNewScale);
if (self->web.maxscaledenom > 0) {
if (dfCurrentScale < dfNewScale && dfNewScale > self->web.maxscaledenom) {
return MS_FAILURE;
}
}
/* ============================================================ */
/* we do a special case for zoom in : we try to zoom as much as */
/* possible using the mincale set in the .map. */
/* ============================================================ */
if (self->web.minscaledenom > 0 && dfNewScale < self->web.minscaledenom && dfCurrentScale > dfNewScale) {
/* To be consistent in swig mapscript and PHP mapscript,
use the same function to calculate the delta extents. */
dfDeltaExt = GetDeltaExtentsUsingScale(scale, self->units, dfGeoPosY, nTmp, self->resolution);
if (dfDeltaExt > 0.0) {
oNewGeorefExt.minx = dfGeoPosX - (dfDeltaExt/2);
oNewGeorefExt.miny = dfGeoPosY - (dfDeltaExt/2);
oNewGeorefExt.maxx = dfGeoPosX + (dfDeltaExt/2);
oNewGeorefExt.maxy = dfGeoPosY + (dfDeltaExt/2);
} else
return MS_FAILURE;
}
/* ------------------------------------------------------------ */
/* If the buffer is set, make sure that the extents do not go */
/* beyond the buffer. */
/* ------------------------------------------------------------ */
if (bMaxExtSet) {
dfDeltaX = oNewGeorefExt.maxx - oNewGeorefExt.minx;
dfDeltaY = oNewGeorefExt.maxy - oNewGeorefExt.miny;
/* Make sure Current georef extents is not bigger
* than max extents */
if (dfDeltaX > (poMaxGeorefExt->maxx-poMaxGeorefExt->minx))
dfDeltaX = poMaxGeorefExt->maxx-poMaxGeorefExt->minx;
if (dfDeltaY > (poMaxGeorefExt->maxy-poMaxGeorefExt->miny))
dfDeltaY = poMaxGeorefExt->maxy-poMaxGeorefExt->miny;
if (oNewGeorefExt.minx < poMaxGeorefExt->minx) {
oNewGeorefExt.minx = poMaxGeorefExt->minx;
oNewGeorefExt.maxx = oNewGeorefExt.minx + dfDeltaX;
}
if (oNewGeorefExt.maxx > poMaxGeorefExt->maxx) {
oNewGeorefExt.maxx = poMaxGeorefExt->maxx;
oNewGeorefExt.minx = oNewGeorefExt.maxx - dfDeltaX;
}
if (oNewGeorefExt.miny < poMaxGeorefExt->miny) {
oNewGeorefExt.miny = poMaxGeorefExt->miny;
oNewGeorefExt.maxy = oNewGeorefExt.miny + dfDeltaY;
}
if (oNewGeorefExt.maxy > poMaxGeorefExt->maxy) {
oNewGeorefExt.maxy = poMaxGeorefExt->maxy;
oNewGeorefExt.miny = oNewGeorefExt.maxy - dfDeltaY;
}
}
self->extent.minx = oNewGeorefExt.minx;
self->extent.miny = oNewGeorefExt.miny;
self->extent.maxx = oNewGeorefExt.maxx;
self->extent.maxy = oNewGeorefExt.maxy;
self->cellsize = msAdjustExtent(&(self->extent), self->width, self->height);
dfDeltaX = self->extent.maxx - self->extent.minx;
dfDeltaY = self->extent.maxy - self->extent.miny;
if (bMaxExtSet) {
if (self->extent.minx < poMaxGeorefExt->minx) {
self->extent.minx = poMaxGeorefExt->minx;
self->extent.maxx = self->extent.minx + dfDeltaX;
}
if (self->extent.maxx > poMaxGeorefExt->maxx) {
self->extent.maxx = poMaxGeorefExt->maxx;
oNewGeorefExt.minx = oNewGeorefExt.maxx - dfDeltaX;
}
if (self->extent.miny < poMaxGeorefExt->miny) {
self->extent.miny = poMaxGeorefExt->miny;
self->extent.maxy = self->extent.miny + dfDeltaY;
}
if (self->extent.maxy > poMaxGeorefExt->maxy) {
self->extent.maxy = poMaxGeorefExt->maxy;
oNewGeorefExt.miny = oNewGeorefExt.maxy - dfDeltaY;
}
}
msCalculateScale(self->extent, self->units, self->width, self->height, self->resolution, &(self->scaledenom));
return MS_SUCCESS;
}
}
%endoffile
%includefile "../swiginc/symbol.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript symbolObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
/* Full support for symbols and addition of them to the map symbolset
is done to resolve MapServer bug 579
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=579 */
%extend symbolObj
{
symbolObj(char *symbolname, const char *imagefile=NULL)
{
symbolObj *symbol;
symbol = (symbolObj *) malloc(sizeof(symbolObj));
initSymbol(symbol);
symbol->name = msStrdup(symbolname);
if (imagefile) {
msLoadImageSymbol(symbol, imagefile);
}
return symbol;
}
~symbolObj()
{
if (self) {
if (msFreeSymbol(self)==MS_SUCCESS) {
free(self);
self=NULL;
}
}
}
int setImagepath(const char *imagefile) {
return msLoadImageSymbol(self, imagefile);
}
int setPoints(lineObj *line) {
int i;
self->sizex = 0;
self->sizey = 0;
for (i=0; i<line->numpoints; i++) {
MS_COPYPOINT(&(self->points[i]), &(line->point[i]));
self->sizex = MS_MAX(self->sizex, self->points[i].x);
self->sizey = MS_MAX(self->sizey, self->points[i].y);
}
self->numpoints = line->numpoints;
return self->numpoints;
}
%feature("new") getPoints;
lineObj *getPoints()
{
int i;
lineObj *line;
line = (lineObj *) malloc(sizeof(lineObj));
line->point = (pointObj *) malloc(sizeof(pointObj)*(self->numpoints));
for (i=0; i<self->numpoints; i++) {
line->point[i].x = self->points[i].x;
line->point[i].y = self->points[i].y;
}
line->numpoints = self->numpoints;
return line;
}
%feature("new") getImage;
imageObj *getImage(outputFormatObj *input_format)
{
imageObj *image = NULL;
outputFormatObj *format = NULL;
rendererVTableObj *renderer = NULL;
if (input_format)
{
format = input_format;
}
else
{
format = msCreateDefaultOutputFormat(NULL, "AGG/PNG", "aggpng");
if (format)
msInitializeRendererVTable(format);
}
if (format == NULL)
{
msSetError(15, "Could not create output format",
"getImage()");
return NULL;
}
renderer = format->vtable;
msPreloadImageSymbol(renderer, self);
if (self->pixmap_buffer)
{
image = msImageCreate(self->pixmap_buffer->width, self->pixmap_buffer->height, format, NULL, NULL,
MS_DEFAULT_RESOLUTION, MS_DEFAULT_RESOLUTION, NULL);
if(!image) {
msSetError(15, "Could not create image",
"getImage()");
return NULL;
}
if(MS_SUCCESS != renderer->mergeRasterBuffer(image, self->pixmap_buffer, 1.0, 0, 0, 0, 0,
self->pixmap_buffer->width, self->pixmap_buffer->height)) {
msSetError(15, "Could not merge symbol image",
"getImage()");
msFreeImage(image);
return NULL;
}
}
return image;
}
int setImage(imageObj *image)
{
rendererVTableObj *renderer = NULL;
renderer = image->format->vtable;
if (self->pixmap_buffer) {
msFreeRasterBuffer(self->pixmap_buffer);
free(self->pixmap_buffer);
}
self->pixmap_buffer = (rasterBufferObj*)malloc(sizeof(rasterBufferObj));
if (!self->pixmap_buffer) {
msSetError(2, NULL, "setImage()");
return MS_FAILURE;
}
self->type = MS_SYMBOL_PIXMAP;
return renderer->getRasterBufferCopy(image, self->pixmap_buffer);
}
}
%endoffile
%includefile "../swiginc/symbolset.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript symbolSetObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend symbolSetObj
{
symbolSetObj(const char *symbolfile=NULL)
{
symbolSetObj *symbolset;
mapObj *temp_map=NULL;
symbolset = (symbolSetObj *) malloc(sizeof(symbolSetObj));
msInitSymbolSet(symbolset);
if (symbolfile) {
symbolset->filename = msStrdup(symbolfile);
temp_map = msNewMapObj();
msLoadSymbolSet(symbolset, temp_map);
symbolset->map = NULL;
msFreeMap(temp_map);
}
return symbolset;
}
~symbolSetObj()
{
msFreeSymbolSet(self);
if (self->filename) free(self->filename);
free(self);
}
%feature("new") getSymbol;
symbolObj *getSymbol(int i)
{
if (i >= 0 && i < self->numsymbols) {
symbolObj *s=self->symbol[i];
MS_REFCNT_INCR(s);
return s;
} else
return NULL;
}
%feature("new") getSymbolByName;
symbolObj *getSymbolByName(char *symbolname)
{
int i;
if (!symbolname) return NULL;
i = msGetSymbolIndex(self, symbolname, 1);
if (i == -1)
return NULL;
else {
MS_REFCNT_INCR(self->symbol[i]);
return self->symbol[i];
}
}
int index(char *symbolname)
{
return msGetSymbolIndex(self, symbolname, 1);
}
int appendSymbol(symbolObj *symbol)
{
return msAppendSymbol(self, symbol);
}
%feature("new") removeSymbol;
symbolObj *removeSymbol(int index)
{
symbolObj *s=msRemoveSymbol(self, index);
if (s!=NULL) {
MS_REFCNT_INCR(s);
}
return s;
}
int save(const char *filename) {
return msSaveSymbolSet(self, filename);
}
}
%endoffile
%includefile "../swiginc/layer.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript layerObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend layerObj
{
layerObj(mapObj *map=NULL)
{
layerObj *layer;
int result;
if (!map) {
layer = (layerObj *) malloc(sizeof(layerObj));
if (!layer) {
msSetError(2, "Failed to initialize Layer",
"layerObj()");
return NULL;
}
result = initLayer(layer, NULL);
if (result == MS_SUCCESS) {
layer->index = -1;
return layer;
}
else {
msSetError(2, "Failed to initialize Layer",
"layerObj()");
return NULL;
}
}
else {
if(msGrowMapLayers(map) == NULL)
return(NULL);
if (initLayer((map->layers[map->numlayers]), map) == -1)
return(NULL);
map->layers[map->numlayers]->index = map->numlayers;
map->layerorder[map->numlayers] = map->numlayers;
map->numlayers++;
MS_REFCNT_INCR(map->layers[map->numlayers-1]);
return (map->layers[map->numlayers-1]);
}
}
void setOpacity(int opacity)
{
msSetLayerOpacity(self, opacity);
}
int getOpacity() {
if(self->compositer) return (self->compositer->opacity);
return (100);
}
~layerObj()
{
/*if (!self->map) {*/
if (self) {
if(freeLayer(self)==MS_SUCCESS) {
free(self);
}
}
}
%feature("new") clone;
layerObj *clone()
{
layerObj *layer;
int result;
layer = (layerObj *) malloc(sizeof(layerObj));
if (!layer) {
msSetError(2, "Failed to initialize Layer",
"layerObj()");
return NULL;
}
result = initLayer(layer, NULL);
if (result != MS_SUCCESS) {
msSetError(2, "Failed to initialize Layer",
"layerObj()");
return NULL;
}
if (msCopyLayer(layer, self) != MS_SUCCESS) {
freeLayer(layer);
free(layer);
layer = NULL;
}
layer->map = NULL;
layer->index = -1;
return layer;
}
int updateFromString(char *snippet)
{
return msUpdateLayerFromString(self, snippet, 0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteLayerToString(self);
}
int insertClass(classObj *classobj, int index=-1)
{
return msInsertClass(self, classobj, index);
}
/* removeClass() */
%feature("new") removeClass;
classObj *removeClass(int index)
{
classObj* c = msRemoveClass(self, index);
if (c != NULL) {
MS_REFCNT_INCR(c);
}
return c;
}
int open()
{
int status;
status = msLayerOpen(self);
if (status == MS_SUCCESS) {
return msLayerGetItems(self);
}
return status;
}
int whichShapes(rectObj rect)
{
int oldconnectiontype = self->connectiontype;
self->connectiontype = MS_INLINE;
if(msLayerWhichItems(self, 1, NULL) != MS_SUCCESS) {
self->connectiontype = oldconnectiontype;
return MS_FAILURE;
}
self->connectiontype = oldconnectiontype;
return msLayerWhichShapes(self, rect, 0);
}
%feature("new") nextShape;
shapeObj *nextShape()
{
int status;
shapeObj *shape;
shape = (shapeObj *)malloc(sizeof(shapeObj));
if (!shape) return NULL;
msInitShape(shape);
status = msLayerNextShape(self, shape);
if(status != MS_SUCCESS) {
msFreeShape(shape);
free(shape);
return NULL;
} else
return shape;
}
void close()
{
msLayerClose(self);
}
%feature("new") getShape;
shapeObj *getShape(resultObj *record)
{
int retval;
shapeObj *shape;
if (!record) return NULL;
shape = (shapeObj *)malloc(sizeof(shapeObj));
if (!shape) return NULL;
msInitShape(shape);
shape->type = self->type; /* is this right? */
retval = msLayerGetShape(self, shape, record);
if(retval != MS_SUCCESS) {
msFreeShape(shape);
free(shape);
return NULL;
} else
return shape;
}
int getNumResults()
{
if (!self->resultcache) return 0;
return self->resultcache->numresults;
}
%feature("new") getResultsBounds;
rectObj *getResultsBounds()
{
rectObj *bounds;
if (!self->resultcache) return NULL;
bounds = (rectObj *) malloc(sizeof(rectObj));
MS_COPYRECT(bounds, &self->resultcache->bounds);
return bounds;
}
resultObj *getResult(int i)
{
if (!self->resultcache) return NULL;
if (i >= 0 && i < self->resultcache->numresults)
return &self->resultcache->results[i];
else
return NULL;
}
%feature("new") getClass;
classObj *getClass(int i)
{
classObj *result=NULL;
if (i >= 0 && i < self->numclasses) {
result=self->class[i];
MS_REFCNT_INCR(result);
}
return result;
}
char *getItem(int i)
{
if (i >= 0 && i < self->numitems)
return (char *) (self->items[i]);
else
return NULL;
}
int setItems(char **items, int numitems) {
return msLayerSetItems(self, items, numitems);
}
int draw(mapObj *map, imageObj *image)
{
return msDrawLayer(map, self, image);
}
int drawQuery(mapObj *map, imageObj *image)
{
return msDrawQueryLayer(map, self, image);
}
/* For querying, we switch layer status ON and then back to original
value before returning. */
int queryByFilter(mapObj *map, char *string)
{
int status;
int retval;
msInitQuery(&(map->query));
map->query.type = MS_QUERY_BY_FILTER;
map->query.mode = MS_QUERY_MULTIPLE;
map->query.filter.string = msStrdup(string);
map->query.filter.type = MS_EXPRESSION;
map->query.layer = self->index;
map->query.rect = map->extent;
status = self->status;
self->status = 1;
retval = msQueryByFilter(map);
self->status = status;
return retval;
}
int queryByAttributes(mapObj *map, char *qitem, char *qstring, int mode)
{
int status;
int retval;
msInitQuery(&(map->query));
map->query.type = MS_QUERY_BY_FILTER;
map->query.mode = mode;
if(qitem) map->query.filteritem = msStrdup(qitem);
if(qstring) {
msInitExpression(&map->query.filter);
msLoadExpressionString(&map->query.filter, qstring);
}
map->query.layer = self->index;
map->query.rect = map->extent;
status = self->status;
self->status = 1;
retval = msQueryByFilter(map);
self->status = status;
return retval;
}
int queryByPoint(mapObj *map, pointObj *point, int mode, double buffer)
{
int status;
int retval;
msInitQuery(&(map->query));
map->query.type = MS_QUERY_BY_POINT;
map->query.mode = mode;
map->query.point = *point;
map->query.buffer = buffer;
map->query.layer = self->index;
status = self->status;
self->status = 1;
retval = msQueryByPoint(map);
self->status = status;
return retval;
}
int queryByRect(mapObj *map, rectObj rect)
{
int status;
int retval;
msInitQuery(&(map->query));
map->query.type = MS_QUERY_BY_RECT;
map->query.mode = MS_QUERY_MULTIPLE;
map->query.rect = rect;
map->query.layer = self->index;
status = self->status;
self->status = 1;
retval = msQueryByRect(map);
self->status = status;
return retval;
}
int queryByFeatures(mapObj *map, int slayer)
{
int status;
int retval;
map->query.slayer = slayer;
map->query.layer = self->index;
status = self->status;
self->status = 1;
retval = msQueryByFeatures(map);
self->status = status;
return retval;
}
int queryByShape(mapObj *map, shapeObj *shape)
{
int status;
int retval;
msInitQuery(&(map->query));
map->query.type = MS_QUERY_BY_SHAPE;
map->query.mode = MS_QUERY_MULTIPLE;
map->query.shape = (shapeObj *) malloc(sizeof(shapeObj));
msInitShape(map->query.shape);
msCopyShape(shape, map->query.shape);
map->query.layer = self->index;
status = self->status;
self->status = 1;
retval = msQueryByShape(map);
self->status = status;
return retval;
}
int queryByIndex(mapObj *map, int tileindex, int shapeindex, int bAddToQuery=0)
{
int status;
int retval;
msInitQuery(&(map->query));
map->query.type = MS_QUERY_BY_INDEX;
map->query.mode = MS_QUERY_SINGLE;
map->query.tileindex = tileindex;
map->query.shapeindex = shapeindex;
map->query.clear_resultcache = !bAddToQuery;
map->query.layer = self->index;
status = self->status;
self->status = 1;
retval = msQueryByIndex(map);
self->status = status;
return retval;
}
resultCacheObj *getResults(void)
{
return self->resultcache;
}
int setFilter(char *filter)
{
if (!filter || strlen(filter) == 0) {
msFreeExpression(&self->filter);
return MS_SUCCESS;
}
else return msLoadExpressionString(&self->filter, filter);
}
%feature("new") getFilterString;
char *getFilterString()
{
return msGetExpressionString(&(self->filter));
}
int setWKTProjection(char *wkt)
{
self->project = 1;
return msOGCWKT2ProjectionObj(wkt, &(self->projection), self->debug);
}
%feature("new") getProjection;
char *getProjection()
{
return (char *) msGetProjectionString(&(self->projection));
}
int setProjection(char *proj4)
{
self->project = 1;
return msLoadProjectionString(&(self->projection), proj4);
}
int addFeature(shapeObj *shape)
{
self->connectiontype = MS_INLINE;
if(self->features != NULL && self->features->tailifhead != NULL)
shape->index = self->features->tailifhead->shape.index + 1;
else
shape->index = 0;
if (insertFeatureList(&(self->features), shape) == NULL)
return MS_FAILURE;
return MS_SUCCESS;
}
/*
Returns the number of inline feature of a layer
*/
int getNumFeatures()
{
return msLayerGetNumFeatures(self);
}
%feature("new") getExtent;
rectObj *getExtent()
{
rectObj *extent;
extent = (rectObj *) malloc(sizeof(rectObj));
msLayerGetExtent(self, extent);
return extent;
}
int setExtent(double minx=-1.0, double miny=-1.0,
double maxx=-1.0, double maxy=-1.0)
{
if (minx > maxx || miny > maxy) {
msSetError(34,
"{ 'minx': %f , 'miny': %f , 'maxx': %f , 'maxy': %f }",
"layerObj::setExtent()", minx, miny, maxx, maxy);
return MS_FAILURE;
}
return msLayerSetExtent(self, minx, miny, maxx, maxy);
}
/*
The following metadata methods are no longer needed since we have
promoted the metadata member of layerObj to a first-class mapscript
object. See hashtable.i. Not yet scheduled for deprecation but
perhaps in the next major release? --SG
*/
char *getMetaData(char *name)
{
char *value = NULL;
if (!name) {
msSetError(16, "NULL key", "getMetaData");
}
value = (char *) msLookupHashTable(&(self->metadata), name);
/*
Umberto, 05/17/2006
Exceptions should be reserved for situations when a serious error occurred
and normal program flow must be interrupted.
In this case returning null should be more that enough.
*/
if (!value) {
msSetError(16, "Key %s does not exist", "getMetaData", name);
return NULL;
}
return value;
}
int setMetaData(char *name, char *value)
{
if (msInsertHashTable(&(self->metadata), name, value) == NULL)
return MS_FAILURE;
return MS_SUCCESS;
}
int removeMetaData(char *name)
{
return(msRemoveHashTable(&(self->metadata), name));
}
char *getFirstMetaDataKey()
{
return (char *) msFirstKeyFromHashTable(&(self->metadata));
}
char *getNextMetaDataKey(char *lastkey)
{
return (char *) msNextKeyFromHashTable(&(self->metadata), lastkey);
}
%feature("new") getWMSFeatureInfoURL;
char *getWMSFeatureInfoURL(mapObj *map, int click_x, int click_y,
int feature_count, char *info_format)
{
return (char *) msWMSGetFeatureInfoURL(map, self, click_x, click_y,
feature_count, info_format);
}
%feature("new") executeWFSGetFeature;
char *executeWFSGetFeature(layerObj *layer)
{
return (char *) msWFSExecuteGetFeature(layer);
}
int applySLD(char *sld, char *stylelayer)
{
return msSLDApplySLD(self->map, sld, self->index, stylelayer, NULL);
}
int applySLDURL(char *sld, char *stylelayer)
{
return msSLDApplySLDURL(self->map, sld, self->index, stylelayer, NULL);
}
%feature("new") generateSLD;
char *generateSLD()
{
return (char *) msSLDGenerateSLD(self->map, self->index, NULL);
}
int isVisible()
{
if (!self->map)
{
msSetError(12,
"visibility has no meaning outside of a map context",
"isVisible()");
return MS_FAILURE;
}
return msLayerIsVisible(self->map, self);
}
int moveClassUp(int index)
{
return msMoveClassUp(self, index);
}
int moveClassDown(int index)
{
return msMoveClassDown(self, index);
}
void setProcessingKey(const char *key, const char *value)
{
msLayerSetProcessingKey( self, key, value );
}
/* this method is deprecated ... should use addProcessing() */
void setProcessing(const char *directive )
{
msLayerAddProcessing( self, directive );
}
void addProcessing(const char *directive )
{
msLayerAddProcessing( self, directive );
}
char *getProcessing(int index)
{
return (char *) msLayerGetProcessing(self, index);
}
char *getProcessingKey(const char *key)
{
return (char *) msLayerGetProcessingKey(self, key);
}
int clearProcessing()
{
return msLayerClearProcessing(self);
}
int setConnectionType(int connectiontype, const char *library_str)
{
/* Caller is responsible to close previous layer correctly before
* calling msConnectLayer()
*/
if (msLayerIsOpen(self))
msLayerClose(self);
return msConnectLayer(self, connectiontype, library_str);
}
int getClassIndex(mapObj *map, shapeObj *shape, int *classgroup=NULL, int numclasses=0) {
return msShapeGetClass(self, map, shape, classgroup, numclasses);
}
char *getGeomTransform()
{
return self->_geomtransform.string;
}
void setGeomTransform(char *transform)
{
msFree(self->_geomtransform.string);
if (!transform || strlen(transform) > 0) {
self->_geomtransform.string = msStrdup(transform);
self->_geomtransform.type = MS_GEOMTRANSFORM_EXPRESSION;
}
else {
self->_geomtransform.type = MS_GEOMTRANSFORM_NONE;
self->_geomtransform.string = NULL;
}
}
%feature("autodoc", "3");
%feature("docstring") "Returns the requested item's field type.
A layer must be open to retrieve the item definition.
Pass in the attribute index to retrieve the type. The
layer's numitems property contains the number of items
available, and the first item is index zero."
char *getItemType(int i)
{
char *itemType = NULL;
if (i >= 0 && i < self->numitems) {
gmlItemListObj *item_list;
item_list = msGMLGetItems(self, "G");
if (item_list != NULL) {
gmlItemObj *item = item_list->items + i;
itemType = msStrdup(item->type);
msGMLFreeItems(item_list); // destroy the original list
}
}
return itemType;
}
}
%endoffile
%includefile "../swiginc/class.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript classObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend classObj {
classObj(layerObj *layer=NULL)
{
classObj *new_class=NULL;
if (!layer)
{
new_class = (classObj *) malloc(sizeof(classObj));
if (!new_class)
{
msSetError(2,
"Could not allocate memory for new classObj instance",
"classObj()");
return NULL;
}
if (initClass(new_class) == -1) return NULL;
new_class->layer = NULL;
return new_class;
}
else
{
if(msGrowLayerClasses(layer) == NULL)
return NULL;
if (initClass(layer->class[layer->numclasses]) == -1)
return NULL;
layer->class[layer->numclasses]->layer = layer;
MS_REFCNT_INCR(layer->class[layer->numclasses]);
layer->numclasses++;
return (layer->class[layer->numclasses-1]);
}
return NULL;
}
~classObj()
{
if (self)
{
if (freeClass(self)==MS_SUCCESS) {
free(self);
self=NULL;
}
}
}
int updateFromString(char *snippet)
{
return msUpdateClassFromString(self, snippet, 0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteClassToString(self);
}
%feature("new") clone;
classObj *clone()
{
classObj *new_class;
new_class = (classObj *) malloc(sizeof(classObj));
if (!new_class)
{
msSetError(2,
"Could not allocate memory for new classObj instance",
"clone()");
return NULL;
}
if (initClass(new_class) == -1)
{
msSetError(2, "Failed to initialize Class",
"clone()");
return NULL;
}
new_class->layer = NULL;
if (msCopyClass(new_class, self, self->layer) != MS_SUCCESS) {
freeClass(new_class);
free(new_class);
new_class = NULL;
}
return new_class;
}
int setExpression(char *expression)
{
if (!expression || strlen(expression) == 0) {
msFreeExpression(&self->expression);
return MS_SUCCESS;
}
else return msLoadExpressionString(&self->expression, expression);
}
%feature("new") getExpressionString;
char *getExpressionString() {
return msGetExpressionString(&(self->expression));
}
int setText(char *text) {
if (!text || strlen(text) == 0) {
msFreeExpression(&self->text);
return MS_SUCCESS;
}
else return msLoadExpressionString(&self->text, text);
}
%feature("new") getTextString;
char *getTextString() {
return msGetExpressionString(&(self->text));
}
char *getMetaData(char *name) {
char *value = NULL;
if (!name) {
msSetError(16, "NULL key", "getMetaData");
}
value = (char *) msLookupHashTable(&(self->metadata), name);
if (!value) {
msSetError(16, "Key %s does not exist", "getMetaData", name);
return NULL;
}
return value;
}
int setMetaData(char *name, char *value) {
if (msInsertHashTable(&(self->metadata), name, value) == NULL)
return MS_FAILURE;
return MS_SUCCESS;
}
char *getFirstMetaDataKey() {
return (char *) msFirstKeyFromHashTable(&(self->metadata));
}
char *getNextMetaDataKey(char *lastkey) {
return (char *) msNextKeyFromHashTable(&(self->metadata), lastkey);
}
int drawLegendIcon(mapObj *map, layerObj *layer, int width, int height, imageObj *dstImage, int dstX, int dstY) {
if(layer->sizeunits != MS_PIXELS) {
map->cellsize = msAdjustExtent(&(map->extent), map->width, map->height);
layer->scalefactor = (msInchesPerUnit(layer->sizeunits,0)/msInchesPerUnit(map->units,0)) / map->cellsize;
}
else
layer->scalefactor = map->resolution/map->defresolution;
return msDrawLegendIcon(map, layer, self, width, height, dstImage, dstX, dstY, 1, NULL);
}
%feature("new") createLegendIcon;
imageObj *createLegendIcon(mapObj *map, layerObj *layer, int width, int height) {
return msCreateLegendIcon(map, layer, self, width, height, 1);
}
%feature("new") getLabel;
labelObj *getLabel(int i) {
if (i >= 0 && i < self->numlabels) {
MS_REFCNT_INCR(self->labels[i]);
return self->labels[i];
} else {
msSetError(31, "Invalid index: %d.", "getLabel()", i);
return NULL;
}
}
int addLabel(labelObj *label) {
return msAddLabelToClass(self, label);
}
%feature("new") removeLabel;
labelObj *removeLabel(int index) {
labelObj* label = (labelObj *) msRemoveLabelFromClass(self, index);
if (label) MS_REFCNT_INCR(label);
return label;
}
/* See Bugzilla issue 548 for more details about the *Style methods */
%feature("new") getStyle;
styleObj *getStyle(int i) {
if (i >= 0 && i < self->numstyles) {
MS_REFCNT_INCR(self->styles[i]);
return self->styles[i];
} else {
msSetError(31, "Invalid index: %d", "getStyle()", i);
return NULL;
}
}
int insertStyle(styleObj *style, int index=-1) {
return msInsertStyle(self, style, index);
}
%feature("new") removeStyle;
styleObj *removeStyle(int index) {
styleObj* style = (styleObj *) msRemoveStyle(self, index);
if (style) MS_REFCNT_INCR(style);
return style;
}
int moveStyleUp(int index) {
return msMoveStyleUp(self, index);
}
int moveStyleDown(int index) {
return msMoveStyleDown(self, index);
}
}
%endoffile
%includefile "../swiginc/cluster.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript clusterObj extensions
Author: Tamas Szekeres
===========================================================================
Copyright (c) 1996-2007 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend clusterObj
{
int updateFromString(char *snippet)
{
return msUpdateClusterFromString(self, snippet);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteClusterToString(self);
}
int setGroup(char *group)
{
if (!group || strlen(group) == 0) {
msFreeExpression(&self->group);
return MS_SUCCESS;
}
else return msLoadExpressionString(&self->group, group);
}
%feature("new") getGroupString;
char *getGroupString() {
return msGetExpressionString(&(self->group));
}
int setFilter(char *filter) {
if (!filter || strlen(filter) == 0) {
msFreeExpression(&self->filter);
return MS_SUCCESS;
}
else return msLoadExpressionString(&self->filter, filter);
}
%feature("new") getFilterString;
char *getFilterString() {
return msGetExpressionString(&(self->filter));
}
}
%endoffile
%includefile "../swiginc/style.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript styleObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
See Bugzilla issue 548 about work on styleObj and classObj
*/
%extend styleObj {
styleObj(classObj *parent_class=NULL)
{
styleObj *style = NULL;
if (parent_class!=NULL) {
if ((style = msGrowClassStyles(parent_class)) == NULL)
return NULL;
if ( initStyle(style) == MS_FAILURE ) {
msSetError(12, "Failed to init new styleObj instance",
"initStyle()");
}
parent_class->numstyles++;
MS_REFCNT_INCR(style);
}
else {
style = (styleObj *) malloc(sizeof(styleObj));
if (!style) {
msSetError(2, "Failed to allocate memory for new styleObj instance",
"styleObj()");
return NULL;
}
if ( initStyle(style) == MS_FAILURE ) {
msSetError(12, "Failed to init new styleObj instance",
"initStyle()");
msFree(style);
return NULL;
}
}
return style;
}
~styleObj()
{
if (self) {
if ( freeStyle(self) == MS_SUCCESS ) {
free(self);
self=NULL;
}
}
}
int updateFromString(char *snippet)
{
return msUpdateStyleFromString(self, snippet, 0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteStyleToString(self);
}
%feature("new") clone;
styleObj *clone()
{
styleObj *style;
style = (styleObj *) malloc(sizeof(styleObj));
if (!style)
{
msSetError(2,
"Could not allocate memory for new styleObj instance",
"clone()");
return NULL;
}
if (initStyle(style) == -1)
{
msSetError(2, "Failed to initialize Style",
"clone()");
return NULL;
}
if (msCopyStyle(style, self) != MS_SUCCESS)
{
free(style);
return NULL;
}
return style;
}
int setSymbolByName(mapObj *map, char* symbolname)
{
self->symbol = msGetSymbolIndex(&map->symbolset, symbolname, 1);
if (self->symbolname) free((char*)self->symbolname);
if (symbolname) self->symbolname = msStrdup(symbolname);
else self->symbolname = 0;
return self->symbol;
}
int removeBinding(int binding)
{
if(binding < 0 || binding >= 12) return MS_FAILURE;
if(self->bindings[binding].item) {
free(self->bindings[binding].item);
self->bindings[binding].item = NULL;
self->bindings[binding].index = -1;
self->numbindings--;
}
return MS_SUCCESS;
}
int setBinding(int binding, char *item)
{
if(!item) return MS_FAILURE;
if(binding < 0 || binding >= 12) return MS_FAILURE;
if(self->bindings[binding].item) {
free(self->bindings[binding].item);
self->bindings[binding].item = NULL;
self->bindings[binding].index = -1;
self->numbindings--;
}
self->bindings[binding].item = msStrdup(item);
self->numbindings++;
return MS_SUCCESS;
}
char *getBinding(int binding)
{
if(binding < 0 || binding >= 12) return NULL;
return self->bindings[binding].item;
}
char *getGeomTransform()
{
return self->_geomtransform.string;
}
void setGeomTransform(char *transform)
{
msStyleSetGeomTransform(self, transform);
}
}
%endoffile
%includefile "../swiginc/rect.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript rectObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend rectObj {
rectObj(double minx=-1.0, double miny=-1.0,
double maxx=-1.0, double maxy=-1.0,
int imageunits=0)
{
rectObj *rect;
if (imageunits == 0)
{
if (minx > maxx || miny > maxy)
{
msSetError(34,
"{ 'minx': %f , 'miny': %f , 'maxx': %f , 'maxy': %f }",
"rectObj()", minx, miny, maxx, maxy);
return NULL;
}
}
else
{
if (minx > maxx || maxy > miny)
{
msSetError(34,
"image (pixel/line) units { 'minx': %f , 'miny': %f , 'maxx': %f , 'maxy': %f }",
"rectObj()", minx, miny, maxx, maxy);
return NULL;
}
}
rect = (rectObj *)calloc(1, sizeof(rectObj));
if (!rect)
return(NULL);
rect->minx = minx;
rect->miny = miny;
rect->maxx = maxx;
rect->maxy = maxy;
return(rect);
}
~rectObj() {
free(self);
}
int project(projectionObj *projin, projectionObj *projout) {
return msProjectRect(projin, projout, self);
}
double fit(int width, int height) {
return msAdjustExtent(self, width, height);
}
int draw(mapObj *map, layerObj *layer, imageObj *image,
int classindex, char *text)
{
shapeObj shape;
int ret;
msInitShape(&shape);
msRectToPolygon(*self, &shape);
shape.classindex = classindex;
if(text && layer->class[classindex]->numlabels > 0) {
shape.text = msStrdup(text);
}
ret = msDrawShape(map, layer, &shape, image, -1, MS_DRAWMODE_FEATURES|MS_DRAWMODE_LABELS);
msFreeShape(&shape);
return ret;
}
%feature("new") getCenter;
pointObj *getCenter()
{
pointObj *center;
center = (pointObj *)calloc(1, sizeof(pointObj));
if (!center) {
msSetError(2, "Failed to allocate memory for point", "getCenter()");
return NULL;
}
center->x = (self->minx + self->maxx)/2;
center->y = (self->miny + self->maxy)/2;
return center;
}
%feature("new") toPolygon;
shapeObj *toPolygon()
{
lineObj line = {0,NULL};
shapeObj *shape;
shape = (shapeObj *)malloc(sizeof(shapeObj));
if (!shape)
return NULL;
msInitShape(shape);
shape->type = MS_SHAPE_POLYGON;
line.point = (pointObj *)malloc(sizeof(pointObj)*5);
line.point[0].x = self->minx;
line.point[0].y = self->miny;
line.point[1].x = self->minx;
line.point[1].y = self->maxy;
line.point[2].x = self->maxx;
line.point[2].y = self->maxy;
line.point[3].x = self->maxx;
line.point[3].y = self->miny;
line.point[4].x = line.point[0].x;
line.point[4].y = line.point[0].y;
line.numpoints = 5;
msAddLine(shape, &line);
msComputeBounds(shape);
free(line.point);
return shape;
}
%feature("new") toString;
char *toString()
{
char buffer[256];
char fmt[]="{ 'minx': %.16g , 'miny': %.16g , 'maxx': %.16g , 'maxy': %.16g }";
msRectToFormattedString(self, (char *) &fmt, (char *) &buffer, 256);
return msStrdup(buffer);
}
}
%endoffile
%includefile "../swiginc/image.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript imageObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
=========================================================================*/
%extend imageObj {
/* imageObj constructor now takes filename as an optional argument. */
imageObj(int width, int height, outputFormatObj *input_format=NULL,
const char *file=NULL,
double resolution=MS_DEFAULT_RESOLUTION, double defresolution=MS_DEFAULT_RESOLUTION)
{
imageObj *image=NULL;
outputFormatObj *format;
rendererVTableObj *renderer = NULL;
rasterBufferObj *rb = NULL;
if (input_format) {
format = input_format;
}
else {
format = msCreateDefaultOutputFormat(NULL, "AGG/PNG", "aggpng");
if (format)
msInitializeRendererVTable(format);
}
if (format == NULL) {
msSetError(15, "Could not create output format",
"imageObj()");
return NULL;
}
if (file) {
renderer = format->vtable;
rb = (rasterBufferObj*) malloc(sizeof(rasterBufferObj));
if (!rb) {
msSetError(2, NULL, "imageObj()");
return NULL;
}
if ( (renderer->loadImageFromFile((char *)file, rb)) == MS_FAILURE) {
msFreeRasterBuffer(rb);
free(rb);
return NULL;
}
image = msImageCreate(rb->width, rb->height, format, NULL, NULL,
resolution, defresolution, NULL);
if (! image) {
msFreeRasterBuffer(rb);
free(rb);
return NULL;
}
if(renderer->mergeRasterBuffer(image, rb, 1.0, 0, 0, 0, 0, rb->width, rb->height) != MS_SUCCESS) {
msFreeImage(image);
image = NULL;
}
msFreeRasterBuffer(rb);
free(rb);
return image;
}
image = msImageCreate(width, height, format, NULL, NULL, resolution, defresolution, NULL);
return image;
}
~imageObj()
{
msFreeImage(self);
}
/* saveGeo - see Bugzilla issue 549 */
void save(char *filename, mapObj *map=NULL)
{
msSaveImage(map, self, filename );
}
/* ======================================================================
write()
Write image data to an open file handle. Intended to replace
saveToString. See python/pyextend.i for the Python specific
version of this method.
====================================================================== */
/*
-------------------------------------------------------------------------
getBytes returns a gdBuffer structure (defined in mapscript.i) which must
be typemapped to an object appropriate to the target language. This
typemap must also msFree the data member of the gdBuffer. See the type-
maps in java/javamodule.i and python/pymodule.i for examples.
contributed by Jerry Pisk, jerry.pisk@gmail.com
-------------------------------------------------------------------------
*/
gdBuffer getBytes()
{
gdBuffer buffer;
buffer.owns_data = 1;
buffer.data = msSaveImageBuffer(self, &buffer.size, self->format);
if( buffer.data == NULL || buffer.size == 0 )
{
buffer.data = NULL;
msSetError(12, "Failed to get image buffer", "getBytes");
return buffer;
}
return buffer;
}
int getSize() {
gdBuffer buffer;
int size=0;
buffer.data = msSaveImageBuffer(self, &buffer.size, self->format);
size = buffer.size;
if( buffer.data == NULL || buffer.size == 0 ) {
buffer.data = NULL;
msSetError(12, "Failed to get image buffer size", "getSize");
}
free(buffer.data);
return size;
}
}
%endoffile
%includefile "../swiginc/shape.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript shapeObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend shapeObj
{
shapeObj(int type=MS_SHAPE_NULL)
{
shapeObj *shape;
shape = (shapeObj *)malloc(sizeof(shapeObj));
if (!shape)
return NULL;
msInitShape(shape);
if(type >= 0) shape->type = type;
return shape;
}
~shapeObj()
{
msFreeShape(self);
free(self);
}
%feature("new") fromWKT;
static shapeObj *fromWKT(char *wkt)
{
shapeObj *shape;
if(!wkt) return NULL;
shape = msShapeFromWKT(wkt);
if(!shape) return NULL;
return shape;
}
int project(projectionObj *projin, projectionObj *projout)
{
return msProjectShape(projin, projout, self);
}
lineObj *get(int i) {
if (i<0 || i>=self->numlines)
return NULL;
else
return &(self->line[i]);
}
int add(lineObj *line) {
return msAddLine(self, line);
}
int draw(mapObj *map, layerObj *layer, imageObj *image) {
return msDrawShape(map, layer, self, image, -1, MS_DRAWMODE_FEATURES|MS_DRAWMODE_LABELS);
}
void setBounds()
{
msComputeBounds(self);
return;
}
%feature("new") clone;
shapeObj *clone()
{
shapeObj *shape;
shape = (shapeObj *)malloc(sizeof(shapeObj));
if (!shape)
return NULL;
msInitShape(shape);
shape->type = self->type;
msCopyShape(self, shape);
return shape;
}
int copy(shapeObj *dest)
{
return(msCopyShape(self, dest));
}
%feature("new") toWKT;
char *toWKT()
{
return msShapeToWKT(self);
}
%feature("new") buffer;
shapeObj *buffer(double width) { return msGEOSBuffer(self, width); }
%feature("new") simplify;
shapeObj *simplify(double tolerance) { return msGEOSSimplify(self, tolerance); }
%feature("new") topologyPreservingSimplify;
shapeObj *topologyPreservingSimplify(double tolerance) { return msGEOSTopologyPreservingSimplify(self, tolerance); }
%feature("new") convexHull;
shapeObj *convexHull() { return msGEOSConvexHull(self); }
%feature("new") boundary;
shapeObj *boundary() { return msGEOSBoundary(self); }
%feature("new") getCentroid;
pointObj *getCentroid() { return msGEOSGetCentroid(self); }
%feature("new") Union;
shapeObj *Union(shapeObj *shape) { return msGEOSUnion(self, shape); }
%feature("new") intersection;
shapeObj *intersection(shapeObj *shape) { return msGEOSIntersection(self, shape); }
%feature("new") difference;
shapeObj *difference(shapeObj *shape) { return msGEOSDifference(self, shape); }
%feature("new") symDifference;
shapeObj *symDifference(shapeObj *shape) { return msGEOSSymDifference(self, shape); }
int contains(shapeObj *shape) { return msGEOSContains(self, shape); }
int overlaps(shapeObj *shape) { return msGEOSOverlaps(self, shape); }
int within(shapeObj *shape) { return msGEOSWithin(self, shape); }
int crosses(shapeObj *shape) { return msGEOSCrosses(self, shape); }
int intersects(shapeObj *shape) { return msGEOSIntersects(self, shape); } /* if GEOS is not present an alternative computation is provided, see mapgeos.c */
int touches(shapeObj *shape) { return msGEOSTouches(self, shape); }
int equals(shapeObj *shape) { return msGEOSEquals(self, shape); }
int disjoint(shapeObj *shape) { return msGEOSDisjoint(self, shape); }
double getArea() { return msGEOSArea(self); }
double getLength() { return msGEOSLength(self); }
char *getValue(int i)
{
if (i >= 0 && i < self->numvalues && self->values)
return (self->values[i]);
else
return NULL;
}
int contains(pointObj *point)
{
if (self->type == MS_SHAPE_POLYGON)
return msIntersectPointPolygon(point, self);
return -1;
}
double distanceToPoint(pointObj *point)
{
return msDistancePointToShape(point, self); /* should there be a GEOS version of this? */
}
double distanceToShape(shapeObj *shape)
{
return msGEOSDistance(self, shape); /* note this calls msDistanceShapeToShape() if GEOS support is not present */
}
%feature("new") getLabelPoint;
pointObj *getLabelPoint()
{
pointObj *point = (pointObj *)calloc(1, sizeof(pointObj));
if (point == NULL) {
msSetError(2, "Failed to allocate memory for point", "labelPoint()");
return NULL;
}
if(self->type == MS_SHAPE_POLYGON && msPolygonLabelPoint(self, point, -1) == MS_SUCCESS)
return point;
free(point);
return NULL;
}
int setValue(int i, char *value)
{
if (!self->values || !value)
{
msSetError(19, "Can't set value", "setValue()");
return MS_FAILURE;
}
if (i >= 0 && i < self->numvalues)
{
msFree(self->values[i]);
self->values[i] = msStrdup(value);
if (!self->values[i])
{
return MS_FAILURE;
}
else return MS_SUCCESS;
}
else
{
msSetError(19, "Invalid value index",
"setValue()");
return MS_FAILURE;
}
}
void initValues(int numvalues)
{
int i;
if(self->values) msFreeCharArray(self->values, self->numvalues);
self->values = NULL;
self->numvalues = 0;
/* Allocate memory for the values */
if (numvalues > 0) {
if ((self->values = (char **)malloc(sizeof(char *)*numvalues)) == NULL) {
msSetError(2, "Failed to allocate memory for values", "shapeObj()");
return;
} else {
for (i=0; i<numvalues; i++) self->values[i] = msStrdup("");
}
self->numvalues = numvalues;
}
}
}
%endoffile
%includefile "../swiginc/point.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript pointObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend pointObj
{
/* Java pointObj constructors are in java/javaextend.i (bug 1106) */
pointObj(double x=0.0, double y=0.0, double z=0.0, double m=-2e38)
{
pointObj *p;
p = (pointObj *)calloc(1,sizeof(pointObj));
if (!p) return NULL;
p->x = x;
p->y = y;
return p;
}
~pointObj()
{
free(self);
}
int project(projectionObj *projin, projectionObj *projout)
{
return msProjectPoint(projin, projout, self);
}
int draw(mapObj *map, layerObj *layer, imageObj *image, int classindex,
char *text)
{
return msDrawPoint(map, layer, self, image, classindex, text);
}
double distanceToPoint(pointObj *point)
{
return msDistancePointToPoint(self, point);
}
double distanceToSegment(pointObj *a, pointObj *b)
{
return msDistancePointToSegment(self, a, b);
}
double distanceToShape(shapeObj *shape)
{
return msDistancePointToShape(self, shape);
}
int setXY(double x, double y, double m=-2e38)
{
self->x = x;
self->y = y;
return MS_SUCCESS;
}
int setXYZ(double x, double y, double z, double m=-2e38)
{
self->x = x;
self->y = y;
return MS_SUCCESS;
}
int setXYZM(double x, double y, double z, double m)
{
self->x = x;
self->y = y;
return MS_SUCCESS;
}
%feature("new") toString;
char *toString()
{
char buffer[256];
const char *fmt;
fmt = "{ 'x': %.16g, 'y': %.16g }";
msPointToFormattedString(self, fmt, (char *) &buffer, 256);
return msStrdup(buffer);
}
%feature("new") toShape;
shapeObj *toShape()
{
shapeObj *shape;
shape = (shapeObj *) malloc(sizeof(shapeObj));
msInitShape(shape);
shape->type = MS_SHAPE_POINT;
shape->line = (lineObj *) malloc(sizeof(lineObj));
shape->numlines = 1;
shape->line[0].point = (pointObj *) malloc(sizeof(pointObj));
shape->line[0].numpoints = 1;
shape->line[0].point[0].x = self->x;
shape->line[0].point[0].y = self->y;
return shape;
}
}
%endoffile
%includefile "../swiginc/line.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript lineObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend lineObj
{
lineObj()
{
lineObj *line;
line = (lineObj *)malloc(sizeof(lineObj));
if (!line)
return(NULL);
line->numpoints=0;
line->point=NULL;
return line;
}
~lineObj()
{
free(self->point);
free(self);
}
int project(projectionObj *projin, projectionObj *projout)
{
return msProjectLine(projin, projout, self);
}
pointObj *get(int i)
{
if (i<0 || i>=self->numpoints)
return NULL;
else
return &(self->point[i]);
}
int add(pointObj *p)
{
if (self->numpoints == 0) { /* new */
self->point = (pointObj *)malloc(sizeof(pointObj));
if (!self->point)
return MS_FAILURE;
} else { /* extend array */
self->point = (pointObj *)realloc(self->point,
sizeof(pointObj)*(self->numpoints+1));
if (!self->point)
return MS_FAILURE;
}
self->point[self->numpoints].x = p->x;
self->point[self->numpoints].y = p->y;
self->numpoints++;
return MS_SUCCESS;
}
int set(int i, pointObj *p)
{
if (i<0 || i>=self->numpoints)
return MS_FAILURE;
self->point[i].x = p->x;
self->point[i].y = p->y;
return MS_SUCCESS;
}
}
%endoffile
%includefile "../swiginc/shapefile.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript shapefileObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend shapefileObj
{
shapefileObj(char *filename, int type=-1)
{
shapefileObj *shapefile;
int status;
shapefile = (shapefileObj *)malloc(sizeof(shapefileObj));
if (!shapefile)
return NULL;
if (type == -1)
status = msShapefileOpen(shapefile, "rb", filename, 1);
else if (type == -2)
status = msShapefileOpen(shapefile, "rb+", filename, 1);
else
status = msShapefileCreate(shapefile, filename, type);
if (status == -1) {
msShapefileClose(shapefile);
free(shapefile);
return NULL;
}
return(shapefile);
}
~shapefileObj()
{
msShapefileClose(self);
free(self);
}
int get(int i, shapeObj *shape)
{
if (i<0 || i>=self->numshapes)
return MS_FAILURE;
msFreeShape(shape); /* frees all lines and points before re-filling */
msSHPReadShape(self->hSHP, i, shape);
return MS_SUCCESS;
}
%feature("new") getShape;
shapeObj *getShape(int i)
{
shapeObj *shape;
shape = (shapeObj *)malloc(sizeof(shapeObj));
if (!shape)
return NULL;
msInitShape(shape);
shape->type = self->type;
msSHPReadShape(self->hSHP, i, shape);
return shape;
}
int getPoint(int i, pointObj *point)
{
if (i<0 || i>=self->numshapes)
return MS_FAILURE;
msSHPReadPoint(self->hSHP, i, point);
return MS_SUCCESS;
}
int getTransformed(mapObj *map, int i, shapeObj *shape)
{
if (i<0 || i>=self->numshapes)
return MS_FAILURE;
msFreeShape(shape); /* frees all lines and points before re-filling */
msSHPReadShape(self->hSHP, i, shape);
msTransformShapeSimplify(shape, map->extent, map->cellsize);
return MS_SUCCESS;
}
void getExtent(int i, rectObj *rect)
{
msSHPReadBounds(self->hSHP, i, rect);
}
int add(shapeObj *shape)
{
/* Trap NULL or empty shapes -- bug 1201 */
if (!shape)
{
msSetError(19, "Can't add NULL shape", "shapefileObj::add");
return MS_FAILURE;
}
else if (!shape->line)
{
msSetError(19, "Can't add empty shape", "shapefileObj::add");
return MS_FAILURE;
}
return msSHPWriteShape(self->hSHP, shape);
}
int addPoint(pointObj *point)
{
return msSHPWritePoint(self->hSHP, point);
}
DBFInfo *getDBF() {
return self->hDBF;
}
}
%endoffile
%includefile "../swiginc/outputformat.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript outputFormatObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend outputFormatObj
{
outputFormatObj(const char *driver, char *name=NULL)
{
outputFormatObj *format;
format = msCreateDefaultOutputFormat(NULL, driver, name);
/* in the case of unsupported formats, msCreateDefaultOutputFormat
should return NULL */
if (!format)
{
msSetError(12, "Unsupported format driver: %s",
"outputFormatObj()", driver);
return NULL;
}
msInitializeRendererVTable(format);
MS_REFCNT_INIT(format);
format->inmapfile = 1;
return format;
}
~outputFormatObj()
{
msFreeOutputFormat( self );
}
void setExtension( const char *extension )
{
msFree( self->extension );
self->extension = msStrdup(extension);
}
void setMimetype( const char *mimetype )
{
msFree( self->mimetype );
self->mimetype = msStrdup(mimetype);
}
void setOption( const char *key, const char *value )
{
msSetOutputFormatOption( self, key, value );
}
int validate()
{
return msOutputFormatValidate( self, 0 );
}
%feature("new") getOption;
char *getOption(const char *key, const char *value="")
{
return msStrdup(msGetOutputFormatOption(self, key, value));
}
%feature("new") getOptionAt;
char* getOptionAt(int i) {
if( i >= 0 && i < self->numformatoptions ) {
return msStrdup(self->formatoptions[i]);
}
return NULL;
}
void attachDevice( void *device )
{
self->device = device;
}
}
%endoffile
%includefile "../swiginc/projection.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript projectionObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend projectionObj
{
projectionObj(char *proj4)
{
int status;
projectionObj *proj=NULL;
proj = (projectionObj *)malloc(sizeof(projectionObj));
if (!proj) return NULL;
msInitProjection(proj);
status = msLoadProjectionString(proj, proj4);
if (status == -1) {
msFreeProjection(proj);
free(proj);
return NULL;
}
return proj;
}
~projectionObj()
{
msFreeProjection(self);
free(self);
}
int setWKTProjection(char* wkt) {
/* no debug output here */
return msOGCWKT2ProjectionObj(wkt, self, 0);
}
int getUnits() {
return GetMapserverUnitUsingProj(self);
}
}
%endoffile
%includefile "../swiginc/dbfinfo.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript DBFInfo extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
/*
class extensions for DBFInfo - TP mods
*/
%extend DBFInfo
{
char *getFieldName(int iField)
{
static char pszFieldName[1000];
int pnWidth;
int pnDecimals;
msDBFGetFieldInfo(self, iField, &pszFieldName[0], &pnWidth,
&pnDecimals);
return pszFieldName;
}
int getFieldWidth(int iField)
{
char pszFieldName[1000];
int pnWidth;
int pnDecimals;
msDBFGetFieldInfo(self, iField, &pszFieldName[0], &pnWidth,
&pnDecimals);
return pnWidth;
}
int getFieldDecimals(int iField)
{
char pszFieldName[1000];
int pnWidth;
int pnDecimals;
msDBFGetFieldInfo(self, iField, &pszFieldName[0], &pnWidth,
&pnDecimals);
return pnDecimals;
}
int getFieldType(int iField)
{
return msDBFGetFieldInfo(self, iField, NULL, NULL, NULL);
}
}
%endoffile
%includefile "../swiginc/labelcache.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript labelCacheObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend labelCacheObj
{
void freeCache()
{
msFreeLabelCache(self);
}
}
%endoffile
%includefile "../swiginc/color.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript colorObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%{
#include "../../mapserver.h"
%}
%extend colorObj
{
colorObj(int red=0, int green=0, int blue=0, int alpha=255)
{
colorObj *color;
/* Check colors */
if (red > 255 || green > 255 || blue > 255 || alpha>255 ||
red<-1 || green<-1 || blue<-1 || alpha<0 ) {
msSetError(12, "Invalid color", "colorObj()");
return NULL;
}
color = (colorObj *)calloc(1, sizeof(colorObj));
if (!color)
return(NULL);
MS_INIT_COLOR(*color, red, green, blue, alpha);
return(color);
}
~colorObj()
{
free(self);
}
int setRGB(int red, int green, int blue, int alpha = 255)
{
/* Check colors */
if (red > 255 || green > 255 || blue > 255 || alpha > 255) {
msSetError(12, "Invalid color index.", "setRGB()");
return MS_FAILURE;
}
MS_INIT_COLOR(*self, red, green, blue, alpha);
return MS_SUCCESS;
}
int setHex(char *psHexColor)
{
int red, green, blue, alpha = 255;
if (psHexColor && (strlen(psHexColor) == 7 || strlen(psHexColor) == 9) && psHexColor[0] == '#') {
red = msHexToInt(psHexColor+1);
green = msHexToInt(psHexColor+3);
blue= msHexToInt(psHexColor+5);
if (strlen(psHexColor) == 9) {
alpha = msHexToInt(psHexColor+7);
}
if (red > 255 || green > 255 || blue > 255 || alpha > 255) {
msSetError(12, "Invalid color index.", "setHex()");
return MS_FAILURE;
}
MS_INIT_COLOR(*self, red, green, blue, alpha);
return MS_SUCCESS;
}
else {
msSetError(12, "Invalid hex color.", "setHex()");
return MS_FAILURE;
}
}
%feature("new") toHex;
char *toHex()
{
char *hexcolor;
if (!self)
{
msSetError(12, "Can't express NULL color as hex",
"toHex()");
return NULL;
}
if (self->red < 0 || self->green < 0 || self->blue < 0)
{
msSetError(12, "Can't express invalid color as hex",
"toHex()");
return NULL;
}
if (self->alpha == 255) {
hexcolor = msSmallMalloc(8);
snprintf(hexcolor, 8, "#%02x%02x%02x",
self->red, self->green, self->blue);
} else if (self->alpha >= 0) {
hexcolor = msSmallMalloc(10);
snprintf(hexcolor, 10, "#%02x%02x%02x%02x",
self->red, self->green, self->blue, self->alpha);
} else {
msSetError(12, "Can't express color with invalid alpha as hex",
"toHex()");
return NULL;
}
return hexcolor;
}
}
%endoffile
%includefile "../swiginc/hashtable.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript hashTableObj extensions
Author: Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%{
#include "../../maphash.h"
%}
/* ========================================================================
* Include maphash header, first stating declarations to ignore
* ======================================================================== */
/* ignore the hashObj struct */
%rename($ignore) hashObj;
/* ignore items and make numitems immutable */
%rename($ignore) items;
%feature("immutable") numitems;
%includefile "../../maphash.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Declarations for the hashTableObj and related stuff.
* Author: Sean Gillies, sgillies@frii.com
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
%constant MS_HASHSIZE = 41;
/* =========================================================================
* Structs
* ========================================================================= */
typedef struct {
%feature("immutable");
int numitems; /* number of items */
%feature("immutable","");
} hashTableObj;
/* =========================================================================
* Functions
* ========================================================================= */
%endoffile
/* ========================================================================
* Extension methods
* ======================================================================== */
%extend hashTableObj {
/* New instance */
hashTableObj(void) {
return msCreateHashTable();
}
/* Destroy instance */
~hashTableObj() {
msFreeHashTable(self);
}
/* set a hash item given key and value */
int set(char *key, char *value) {
if (msInsertHashTable(self, key, value) == NULL) {
return MS_FAILURE;
}
return MS_SUCCESS;
}
/* get value from item by its key */
char *get(char *key, char *default_value=NULL) {
char *value = NULL;
if (!key) {
msSetError(16, "NULL key", "get");
}
value = (char *) msLookupHashTable(self, key);
if (!value) {
return default_value;
}
return value;
}
/* Remove one item from hash table */
int remove(char *key) {
return msRemoveHashTable(self, key);
}
/* Clear all items in hash table (to NULL) */
void clear(void) {
msFreeHashItems(self);
initHashTable(self);
}
/* Return the next key or first key if prevkey == NULL */
const char *nextKey(char *prevkey=NULL) {
return msNextKeyFromHashTable(self, (const char *) prevkey);
}
}
%endoffile
%includefile "../swiginc/resultcache.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript resultCacheObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend resultCacheObj
{
resultObj *getResult(int i)
{
if (i >= 0 && i < self->numresults) {
return &self->results[i];
}
return NULL;
}
}
%endoffile
%includefile "../swiginc/result.i" %beginfile
/* ===========================================================================
$Id: shape.i 9558 2009-11-20 18:11:50Z sdlime $
Project: MapServer
Purpose: SWIG interface file for mapscript shapeObj extensions
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend resultObj
{
resultObj(long shapeindex)
{
resultObj *result = (resultObj *) msSmallMalloc(sizeof(resultObj));
result->tileindex = -1;
result->resultindex = -1;
result->shapeindex = shapeindex;
return result;
}
~resultObj()
{
free(self);
}
}
%endoffile
%includefile "../swiginc/owsrequest.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for manipulating OGC request stuff via
mapscript.
Author: Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 2004 Sean Gillies
Copyright (c) 2006 Frank Warmerdam
Copyright (c) 1996-2007 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%{
static char *msGetEnvURL( const char *key, void *thread_context )
{
if( strcmp(key,"REQUEST_METHOD") == 0 )
return "GET";
if( strcmp(key,"QUERY_STRING") == 0 )
return (char *) thread_context;
return NULL;
}
%}
%rename(OWSRequest) cgiRequestObj;
%includefile "../../cgiutil.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: cgiRequestObj and CGI parsing utility related declarations.
* Author: Steve Lime and the MapServer team.
*
* Notes: Portions derived from NCSA HTTPd Server's example CGI programs (util.c).
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
/*
** Misc. defines
*/
%constant MS_DEFAULT_CGI_PARAMS = 100;
enum MS_REQUEST_TYPE {MS_GET_REQUEST, MS_POST_REQUEST};
/* structure to hold request information */
typedef struct {
%feature("immutable");
int NumParams;
%feature("immutable","");
enum MS_REQUEST_TYPE type;
char *contenttype;
char *postrequest;
char *httpcookiedata;
} cgiRequestObj;
/*
** Function prototypes
*/
%endoffile
/* Class for programming OWS services - SG */
%extend cgiRequestObj {
cgiRequestObj()
{
cgiRequestObj *request;
request = msAllocCgiObj();
if (!request) {
msSetError(13, "Failed to initialize object","OWSRequest()");
return NULL;
}
return request;
}
~cgiRequestObj()
{
msFreeCgiObj(self);
}
int loadParams()
{
self->NumParams = loadParams( self, NULL, NULL, 0, NULL);
return self->NumParams;
}
int loadParamsFromURL( const char *url )
{
self->NumParams = loadParams( self, msGetEnvURL, NULL, 0, (void*)url );
return self->NumParams;
}
void setParameter(char *name, char *value)
{
int i;
if (self->NumParams == 100) {
msSetError(31, "Maximum number of items, %d, has been reached", "setItem()", 100);
}
for (i=0; i<self->NumParams; i++) {
if (strcasecmp(self->ParamNames[i], name) == 0) {
free(self->ParamValues[i]);
self->ParamValues[i] = msStrdup(value);
break;
}
}
if (i == self->NumParams) {
self->ParamNames[self->NumParams] = msStrdup(name);
self->ParamValues[self->NumParams] = msStrdup(value);
self->NumParams++;
}
}
void addParameter(char *name, char *value)
{
if (self->NumParams == 100) {
msSetError(31, "Maximum number of items, %d, has been reached", "addParameter()", 100);
}
self->ParamNames[self->NumParams] = msStrdup(name);
self->ParamValues[self->NumParams] = msStrdup(value);
self->NumParams++;
}
char *getName(int index)
{
if (index < 0 || index >= self->NumParams) {
msSetError(31, "Invalid index, valid range is [0, %d]", "getName()", self->NumParams-1);
return NULL;
}
return self->ParamNames[index];
}
char *getValue(int index)
{
if (index < 0 || index >= self->NumParams) {
msSetError(31, "Invalid index, valid range is [0, %d]", "getValue()", self->NumParams-1);
return NULL;
}
return self->ParamValues[index];
}
char *getValueByName(const char *name)
{
int i;
for (i=0; i<self->NumParams; i++) {
if (strcasecmp(self->ParamNames[i], name) == 0) {
return self->ParamValues[i];
}
}
return NULL;
}
}
%endoffile
%includefile "../swiginc/connpool.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for connection pool management
Author: Umberto Nicoletti, unicoletti@prometeo.it
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
void msConnPoolCloseUnreferenced();
%endoffile
%includefile "../swiginc/msio.i" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Definitions for MapServer IO redirection capability.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
* Note:
* copied from mapio.h to avoid to much #ifdef swigging
*
******************************************************************************
* Copyright (c) 2004, Frank Warmerdam <warmerdam@pobox.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
/* $Id$ */
void msIO_resetHandlers(void);
void msIO_installStdoutToBuffer(void);
void msIO_installStdinFromBuffer(void);
%feature("new") msIO_stripStdoutBufferContentType;
const char *msIO_stripStdoutBufferContentType();
void msIO_stripStdoutBufferContentHeaders(void);
/* mapscript only extensions */
const char *msIO_getStdoutBufferString(void);
gdBuffer msIO_getStdoutBufferBytes(void);
%feature("new") msIO_getAndStripStdoutBufferMimeHeaders;
hashTableObj* msIO_getAndStripStdoutBufferMimeHeaders(void);
%{
const char *msIO_getStdoutBufferString() {
msIOContext *ctx = msIO_getHandler( (FILE *) "stdout" );
msIOBuffer *buf;
if( ctx == NULL || ctx->write_channel == MS_FALSE
|| strcmp(ctx->label,"buffer") != 0 )
{
msSetError( MS_MISCERR, "Can't identify msIO buffer.",
"msIO_getStdoutBufferString" );
return "";
}
buf = (msIOBuffer *) ctx->cbData;
/* write one zero byte and backtrack if it isn't already there */
if( buf->data_len == 0 || buf->data[buf->data_offset] != '\0' ) {
msIO_bufferWrite( buf, "", 1 );
buf->data_offset--;
}
return (const char *) (buf->data);
}
gdBuffer msIO_getStdoutBufferBytes() {
msIOContext *ctx = msIO_getHandler( (FILE *) "stdout" );
msIOBuffer *buf;
gdBuffer gdBuf;
if( ctx == NULL || ctx->write_channel == MS_FALSE
|| strcmp(ctx->label,"buffer") != 0 )
{
msSetError( MS_MISCERR, "Can't identify msIO buffer.",
"msIO_getStdoutBufferString" );
gdBuf.data = (unsigned char*)"";
gdBuf.size = 0;
gdBuf.owns_data = MS_FALSE;
return gdBuf;
}
buf = (msIOBuffer *) ctx->cbData;
gdBuf.data = buf->data;
gdBuf.size = buf->data_offset;
gdBuf.owns_data = MS_TRUE;
/* we are seizing ownership of the buffer contents */
buf->data_offset = 0;
buf->data_len = 0;
buf->data = NULL;
return gdBuf;
}
%}
%endoffile
%includefile "../swiginc/web.i" %beginfile
/* ===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for mapscript webObj extensions
Author: Steve Lime
Umberto Nicoletti unicoletti@prometeo.it
===========================================================================
Copyright (c) 1996-2001 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
/* Constructor and destructor for webObj
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=579 */
%extend webObj
{
webObj()
{
webObj *web;
web = (webObj *) malloc(sizeof(webObj));
initWeb(web);
return web;
}
~webObj()
{
if (!self) return;
freeWeb(self);
free(self);
}
int updateFromString(char *snippet)
{
return msUpdateWebFromString(self, snippet, 0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteWebToString(self);
}
}
%endoffile
%includefile "../swiginc/label.i" %beginfile
/* ===========================================================================
$Id: $
Project: MapServer
Purpose: SWIG interface file for mapscript labelObj extensions
Author: Steve Lime
===========================================================================
Copyright (c) 1996-2007 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend labelObj
{
labelObj()
{
labelObj *label;
label = (labelObj *)calloc(1, sizeof(labelObj));
if (!label)
return(NULL);
initLabel(label);
return(label);
}
~labelObj()
{
freeLabel(self);
}
int updateFromString(char *snippet)
{
return msUpdateLabelFromString(self, snippet,0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteLabelToString(self);
}
int removeBinding(int binding)
{
if(binding < 0 || binding >= 9) return MS_FAILURE;
if(self->bindings[binding].item) {
free(self->bindings[binding].item);
self->bindings[binding].item = NULL;
self->bindings[binding].index = -1;
self->numbindings--;
}
return MS_SUCCESS;
}
char *getBinding(int binding)
{
if(binding < 0 || binding >= 9) return NULL;
return self->bindings[binding].item;
}
int setBinding(int binding, char *item)
{
if(!item) return MS_FAILURE;
if(binding < 0 || binding >= 9) return MS_FAILURE;
if(self->bindings[binding].item) {
free(self->bindings[binding].item);
self->bindings[binding].item = NULL;
self->bindings[binding].index = -1;
self->numbindings--;
}
self->bindings[binding].item = msStrdup(item);
self->numbindings++;
return MS_SUCCESS;
}
int setExpression(char *expression)
{
if (!expression || strlen(expression) == 0) {
msFreeExpression(&self->expression);
return MS_SUCCESS;
}
else return msLoadExpressionString(&self->expression, expression);
}
%feature("new") getExpressionString;
char *getExpressionString() {
return msGetExpressionString(&(self->expression));
}
int setText(char *text) {
if (!text || strlen(text) == 0) {
msFreeExpression(&self->text);
return MS_SUCCESS;
}
else return msLoadExpressionString(&self->text, text);
}
%feature("new") getTextString;
char *getTextString() {
return msGetExpressionString(&(self->text));
}
%feature("new") getStyle;
styleObj *getStyle(int i) {
if (i >= 0 && i < self->numstyles) {
MS_REFCNT_INCR(self->styles[i]);
return self->styles[i];
} else {
msSetError(31, "Invalid index: %d", "getStyle()", i);
return NULL;
}
}
int insertStyle(styleObj *style, int index=-1) {
return msInsertLabelStyle(self, style, index);
}
%feature("new") removeStyle;
styleObj *removeStyle(int index) {
styleObj* style = (styleObj *) msRemoveLabelStyle(self, index);
if (style)
MS_REFCNT_INCR(style);
return style;
}
int moveStyleUp(int index) {
return msMoveLabelStyleUp(self, index);
}
int moveStyleDown(int index) {
return msMoveLabelStyleDown(self, index);
}
}
%endoffile
%includefile "../swiginc/scalebar.i" %beginfile
/* ===========================================================================
$Id: $
Project: MapServer
Purpose: SWIG interface file for mapscript scalebarObj extensions
Author: Steve Lime
===========================================================================
Copyright (c) 1996-2007 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend scalebarObj
{
int updateFromString(char *snippet)
{
return msUpdateScalebarFromString(self, snippet, 0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteScalebarToString(self);
}
}
%endoffile
%includefile "../swiginc/legend.i" %beginfile
/* ===========================================================================
$Id: $
Project: MapServer
Purpose: SWIG interface file for mapscript legendObj extensions
Author: Steve Lime
===========================================================================
Copyright (c) 1996-2007 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend legendObj
{
int updateFromString(char *snippet)
{
return msUpdateLegendFromString(self, snippet, 0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteLegendToString(self);
}
}
%endoffile
%includefile "../swiginc/referencemap.i" %beginfile
/* ===========================================================================
$Id: $
Project: MapServer
Purpose: SWIG interface file for mapscript referenceMapObj extensions
Author: Steve Lime
===========================================================================
Copyright (c) 1996-2007 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend referenceMapObj
{
int updateFromString(char *snippet)
{
return msUpdateReferenceMapFromString(self, snippet, 0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteReferenceMapToString(self);
}
}
%endoffile
%includefile "../swiginc/querymap.i" %beginfile
/* ===========================================================================
$Id: $
Project: MapServer
Purpose: SWIG interface file for mapscript queryMapObj extensions
Author: Steve Lime
===========================================================================
Copyright (c) 1996-2007 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
===========================================================================
*/
%extend queryMapObj
{
int updateFromString(char *snippet)
{
return msUpdateQueryMapFromString(self, snippet, 0);
}
%feature("new") convertToString;
char* convertToString()
{
return msWriteQueryMapToString(self);
}
}
%endoffile
/*
=============================================================================
Language-specific extensions to mapserver classes are included here
=============================================================================
*/
/* Java */
/* Python */
%includefile "pyextend.i" %beginfile
/******************************************************************************
* Project: MapServer
* Purpose: Python-specific extensions to MapScript objects
* Author: Sean Gillies, sgillies@frii.com
* Author: Seth Girvin, sethg@geographika.co.uk
*
******************************************************************************
*
* Python-specific mapscript code has been moved into this
* SWIG interface file to improve the readability of the main
* interface file. The main mapscript.i file includes this
* file when SWIGPYTHON is defined (via 'swig -python ...').
*
*****************************************************************************/
/* fromstring: Factory for mapfile objects */
%insert("python") %{
def fromstring(data, mappath=None):
"""Creates map objects from mapfile strings.
Parameters
==========
data : string
Mapfile in a string.
mappath : string
Optional root map path, enabling relative paths in mapfile.
Example
=======
>>> mo = fromstring("MAP\nNAME 'test'\nEND")
>>> mo.name
'test'
"""
import re
if re.search(r"^\s*MAP", data, re.I):
return msLoadMapFromString(data, mappath)
elif re.search(r"^\s*LAYER", data, re.I):
ob = layerObj()
ob.updateFromString(data)
return ob
elif re.search(r"^\s*CLASS", data, re.I):
ob = classObj()
ob.updateFromString(data)
return ob
elif re.search(r"^\s*STYLE", data, re.I):
ob = styleObj()
ob.updateFromString(data)
return ob
else:
raise ValueError("No map, layer, class, or style found. Can not load from provided string")
%}
/* ===========================================================================
Python rectObj extensions
======================================================================== */
%extend rectObj {
%insert("python") %{
def __str__(self):
return self.toString()
def __contains__(self, item):
item_type = item.__class__.__name__
if item_type == "pointObj":
if item.x >= self.minx and item.x <= self.maxx \
and item.y >= self.miny and item.y <= self.maxy:
return True
else:
return False
else:
raise TypeError('__contains__ does not yet handle %s' % (item_type))
%}
}
/* ===========================================================================
Python pointObj extensions
======================================================================== */
%extend pointObj {
%insert("python") %{
def __str__(self):
return self.toString()
@property
def __geo_interface__(self):
if hasattr(self, "z"):
coords = (self.x, self.y, self.z)
else:
coords = (self.x, self.y)
return {"type": "Point", "coordinates": coords}
%}
}
/* ===========================================================================
Python lineObj extensions
======================================================================== */
%extend lineObj {
%insert("python") %{
@property
def __geo_interface__(self):
coords = []
for idx in range(0, self.numpoints):
pt = self.get(idx)
geom = pt.__geo_interface__
coords.append(geom["coordinates"])
return {"type": "LineString", "coordinates": coords}
%}
}
/* ===========================================================================
Python shapeObj extensions
======================================================================== */
%extend shapeObj {
%insert("python") %{
def _convert_item_values(self, property_values, property_types):
"""
**Python MapScript only**
Convert an item value, which is always stored as a string, into a
Python type, based on an attributes GML metadata type. These can be one
of the following:
``Integer|Long|Real|Character|Date|Boolean``
"""
typed_values = []
for value, type_ in zip(property_values, property_types):
try:
if type_.lower() == "integer":
value = int(value)
elif type_.lower() == "long":
value = long(value)
elif type_.lower() == "real":
value = float(value)
else:
pass
except ValueError:
pass
typed_values.append(value)
return typed_values
@property
def __geo_interface__(self):
bounds = self.bounds
ms_geom_type = self.type
# see https://tools.ietf.org/html/rfc7946 for GeoJSON types
if ms_geom_type == MS_SHAPE_POINT or ms_geom_type == MS_SHP_POINTZ or ms_geom_type == MS_SHP_POINTM:
geom_type = "Point"
elif ms_geom_type == MS_SHP_MULTIPOINTZ or ms_geom_type == MS_SHP_MULTIPOINTM:
geom_type = "MultiPoint"
elif ms_geom_type == MS_SHAPE_LINE or ms_geom_type == MS_SHP_ARCZ or ms_geom_type == MS_SHP_ARCM:
if self.numlines == 1:
geom_type = "LineString"
else:
geom_type = "MultiLineString"
elif ms_geom_type == MS_SHAPE_POLYGON or ms_geom_type == MS_SHP_POLYGONZ or ms_geom_type == MS_SHP_POLYGONM:
if self.numlines == 1:
geom_type = "Polygon"
else:
geom_type = "MultiPolygon"
elif ms_geom_type == MS_SHAPE_NULL:
return None
else:
raise TypeError("Shape type {} not supported".format(geom_type))
properties = {}
coords = []
# property names are stored at the layer level
# https://github.com/mapserver/mapserver/issues/130
property_values = [self.getValue(idx) for idx in range(0, self.numvalues)]
if hasattr(self, "_item_definitions"):
property_names, property_types = zip(*self._item_definitions)
property_values = self._convert_item_values(property_values, property_types)
else:
property_names = [str(idx) for idx in range(0, self.numvalues)]
properties = dict(zip(property_names, property_values))
for idx in range(0, self.numlines):
line = self.get(idx)
geom = line.__geo_interface__
coords.append(geom["coordinates"])
return {
"type": "Feature",
"bbox": (bounds.minx, bounds.miny, bounds.maxx, bounds.maxy),
"properties": properties,
"geometry": {
"type": geom_type,
"coordinates": coords
}
}
def getItemDefinitions(self):
return self._item_definitions
def setItemDefinitions(self, item_definitions):
self._item_definitions = item_definitions
__swig_getmethods__["itemdefinitions"] = getItemDefinitions
__swig_setmethods__["itemdefinitions"] = setItemDefinitions
%}
}
/******************************************************************************
* Extensions to mapObj
*****************************************************************************/
%extend mapObj {
/* getLayerOrder() extension returns the map layerorder as a native
sequence */
PyObject *getLayerOrder() {
int i;
PyObject *order;
order = PyTuple_New(self->numlayers);
for (i = 0; i < self->numlayers; i++) {
PyTuple_SetItem(order,i,PyInt_FromLong((long)self->layerorder[i]));
}
return order;
}
int setLayerOrder(PyObject *order) {
int i, size;
size = PyTuple_Size(order);
for (i = 0; i < size; i++) {
self->layerorder[i] = (int)PyInt_AsLong(PyTuple_GetItem(order, i));
}
return MS_SUCCESS;
}
PyObject* getSize()
{
PyObject* output ;
output = PyTuple_New(2);
PyTuple_SetItem(output,0,PyInt_FromLong((long)self->width));
PyTuple_SetItem(output,1,PyInt_FromLong((long)self->height));
return output;
}
%insert("python") %{
def get_height(self):
return self.getSize()[1] # <-- second member is the height
def get_width(self):
return self.getSize()[0] # <-- first member is the width
def set_height(self, value):
return self.setSize(self.getSize()[0], value)
def set_width(self, value):
return self.setSize(value, self.getSize()[1])
width = property(get_width, set_width)
height = property(get_height, set_height)
%}
}
/******************************************************************************
* Extensions to layerObj
*****************************************************************************/
%extend layerObj {
%insert("python") %{
def getItemDefinitions(self):
"""
**Python MapScript only**
Return item (field) names and their types if available.
Field types are specified using GML metadata and can be one of the following:
``Integer|Long|Real|Character|Date|Boolean``
"""
item_names = [self.getItem(idx) for idx in range(0, self.numitems)]
item_types = [self.getItemType(idx) for idx in range(0, self.numitems)]
return zip(item_names, item_types)
%}
}
/******************************************************************************
* Extensions to imageObj
*****************************************************************************/
%extend imageObj {
/* ======================================================================
write()
Write image data to an open Python file or file-like object.
Overrides extension method in mapscript/swiginc/image.i.
Intended to replace saveToString.
====================================================================== */
int write( PyObject *file=Py_None )
{
unsigned char *imgbuffer=NULL;
int imgsize;
PyObject *noerr;
int retval=MS_FAILURE;
rendererVTableObj *renderer = NULL;
/* Return immediately if image driver is not GD */
if ( !MS_RENDERER_PLUGIN(self->format) )
{
msSetError(15, "Writing of %s format not implemented",
"imageObj::write", self->format->driver);
return MS_FAILURE;
}
if (file == Py_None) /* write to stdout */
retval = msSaveImage(NULL, self, NULL);
else /* presume a Python file-like object */
{
imgbuffer = msSaveImageBuffer(self, &imgsize,
self->format);
if (imgsize == 0)
{
msSetError(15, "failed to get image buffer", "write()");
return MS_FAILURE;
}
#if PY_MAJOR_VERSION >= 3
// https://docs.python.org/3/c-api/arg.html
noerr = PyObject_CallMethod(file, "write", "y#", imgbuffer, imgsize);
#else
// https://docs.python.org/2/c-api/arg.html
noerr = PyObject_CallMethod(file, "write", "s#", imgbuffer, imgsize);
#endif
free(imgbuffer);
if (noerr == NULL)
return MS_FAILURE;
else
Py_DECREF(noerr);
retval = MS_SUCCESS;
}
return retval;
}
/* Deprecated */
PyObject *saveToString() {
int size=0;
unsigned char *imgbytes;
PyObject *imgstring;
imgbytes = msSaveImageBuffer(self, &size, self->format);
if (size == 0)
{
msSetError(15, "failed to get image buffer", "saveToString()");
return NULL;
}
imgstring = PyBytes_FromStringAndSize((const char*) imgbytes, size);
free(imgbytes);
return imgstring;
}
}
/******************************************************************************
* Extensions to styleObj
*****************************************************************************/
%extend styleObj {
void pattern_set(int nListSize, double* pListValues)
{
if( nListSize < 2 )
{
msSetError(4, "Not enough pattern elements. A minimum of 2 are required", "pattern_set()");
return;
}
if( nListSize > 10 )
{
msSetError(12, "Too many elements", "pattern_set()");
return;
}
memcpy( self->pattern, pListValues, sizeof(double) * nListSize);
self->patternlength = nListSize;
}
void pattern_get(double** argout, int* pnListSize)
{
*pnListSize = self->patternlength;
*argout = (double*) malloc(sizeof(double) * *pnListSize);
memcpy( *argout, self->pattern, sizeof(double) * *pnListSize);
}
void patternlength_set2(int patternlength)
{
msSetError(12, "pattern is read-only", "patternlength_set()");
}
%insert("python") %{
__swig_setmethods__["patternlength"] = _mapscript.styleObj_patternlength_set2
__swig_getmethods__["patternlength"] = _mapscript.styleObj_patternlength_get
if _newclass:patternlength = _swig_property(_mapscript.styleObj_patternlength_get, _mapscript.styleObj_patternlength_set2)
__swig_setmethods__["pattern"] = _mapscript.styleObj_pattern_set
__swig_getmethods__["pattern"] = _mapscript.styleObj_pattern_get
if _newclass:pattern = _swig_property(_mapscript.styleObj_pattern_get, _mapscript.styleObj_pattern_set)
%}
}
/******************************************************************************
* Extensions to hashTableObj - add dict methods
*****************************************************************************/
%extend hashTableObj{
%insert("python") %{
def __getitem__(self, key):
return self.get(key)
def __setitem__(self, key, value):
return self.set(key, value)
def __delitem__(self, key) :
return self.remove(key)
def __contains__(self, key):
return key.lower() in [k.lower() for k in self.keys()]
def __len__(self):
return self.numitems
def keys(self):
keys = []
k = None
while True :
k = self.nextKey(k)
if k :
keys.append(k)
else :
break
return keys
%}
}
%endoffile
/* Ruby */
%endoffile
root@php-mapscript:/build/mapserver/mapscript/python#
root@php-mapscript:/build/mapserver/mapscript/python#
root@php-mapscript:/build/mapserver/mapscript/python#
root@php-mapscript:/build/mapserver/mapscript/python#
root@php-mapscript:/build/mapserver/mapscript/python# clear
root@php-mapscript:/build/mapserver/mapscript/python# swig -python -E -o mapscript_wrap.c ../mapscript.i
%includefile "/usr/share/swig/4.0.0/swig.swg" %beginfile
/* -----------------------------------------------------------------------------
* swig.swg
*
* Common macro definitions for various SWIG directives. This file is always
* included at the top of each input file.
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* User Directives
* ----------------------------------------------------------------------------- */
/* Deprecated SWIG-1.1 directives */
/* Code insertion directives such as %wrapper %{ ... %} */
/* Class extension */
/* %ignore directive */
/* Access control directives */
/* Generation of default constructors/destructors (old form, don't use) */
/* Disable the generation of implicit default constructor */
/* Disable the generation of implicit default destructor (dangerous) */
/* Enable the generation of copy constructor */
/* Force the old nodefault behavior, ie disable both constructor and destructor */
/* the %exception directive */
/* the %allowexception directive allows the %exception feature to
be applied to set/get variable methods */
/* the %exceptionvar directive, as %exception but it is only applied
to set/get variable methods. You don't need to use the
%allowexception directive when using %exceptionvar.
*/
/* the %catches directive */
/* the %exceptionclass directive */
/* the %newobject directive */
/* the %delobject directive */
/* the %refobject/%unrefobject directives */
/* Directives for callback functions (experimental) */
/* the %nestedworkaround directive (deprecated) */
/* the %flatnested directive */
/* the %fastdispatch directive */
/* directors directives */
/* naturalvar directives */
/* nspace directives */
/* valuewrapper directives */
/* Contract support - Experimental and undocumented */
/* Macro for setting a dynamic cast function */
/* aggregation support */
/*
This macro performs constant aggregation. Basically the idea of
constant aggregation is that you can group a collection of constants
together. For example, suppose you have some code like this:
#define UP 1
#define DOWN 2
#define LEFT 3
#define RIGHT 4
Now, suppose you had a function like this:
int move(int direction)
In this case, you might want to restrict the direction argument to
one of the supplied constant names. To do this, you could write some
typemap code by hand. Alternatively, you can use the
%aggregate_check macro defined here to create a simple check
function for you. Here is an example:
%aggregate_check(int, check_direction, UP, DOWN, LEFT, RIGHT);
Now, using a typemap
%typemap(check) int direction {
if (!check_direction($1)) SWIG_exception(SWIG_ValueError,"Bad direction.");
}
or a contract (better)
%contract move(int x) {
require:
check_direction(x);
}
*/
/* -----------------------------------------------------------------------------
* %rename predicates
* ----------------------------------------------------------------------------- */
/*
Predicates to be used with %rename, for example:
- to rename all the functions:
%rename("%(utitle)s", %$isfunction) "";
- to rename only the member methods:
%rename("m_%(utitle)s", %$isfunction, %$ismember) "";
- to rename only the global functions:
%rename("m_%(utitle)s", %$isfunction, %$not %$ismember) "";
or
%rename("g_%(utitle)s", %$isfunction, %$isglobal) "";
- to ignore the enumitems in a given class:
%rename("$ignore", %$isenumitem, %$classname="MyClass") "";
we use the prefix '%$' to avoid clashes with other swig
macros/directives.
*/
/* %constant definition */
/* -----------------------------------------------------------------------------
* Common includes for warning labels, macros, fragments etc
* ----------------------------------------------------------------------------- */
%includefile "/usr/share/swig/4.0.0/swigwarnings.swg" %beginfile
/*
Include the internal swig macro codes. These macros correspond to
the one found in Source/Include/swigwarn.h plus the 'SWIG' prefix.
For example, in the include file 'swigwarn.h' you will find
#define WARN_TYPEMAP_CHARLEAK ...
and in the 'swigwarn.swg' interface, you will see
%define SWIGWARN_TYPEMAP_CHARLEAK ...
This code can be used in warning filters as follows:
%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK);
Warnings messages used in typemaps. Message names will be the same
as those in Lib/swigwarn.swg but with the suffix _MSG.
For example, for the code SWIGWARN_TYPEMAP_CHARLEAK, once you use
%typemapmsg(CHARLEAK,<msg>);
you use the message in your typemap as
%typemap(varin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) char *
while you suppress the warning using
%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK);
as described above.
*/
/* -----------------------------------------------------------------------------
* SWIG warning codes
* ----------------------------------------------------------------------------- */
%includefile "/usr/share/swig/4.0.0/swigwarn.swg" %beginfile
/* SWIG warning codes - generated from swigwarn.h - do not edit */
/* -- Deprecated features -- */
/* -- Preprocessor -- */
/* -- C/C++ Parser -- */
/* redundant now */
/* redundant now */
/* new */
/* delete */
/* + */
/* - */
/* * */
/* / */
/* % */
/* ^ */
/* & */
/* | */
/* ~ */
/* ! */
/* = */
/* < */
/* > */
/* += */
/* -= */
/* *= */
/* /= */
/* %= */
/* ^= */
/* &= */
/* |= */
/* << */
/* >> */
/* <<= */
/* >>= */
/* == */
/* != */
/* <= */
/* >= */
/* && */
/* || */
/* ++ */
/* -- */
/* , */
/* ->* */
/* -> */
/* () */
/* [] */
/* + */
/* - */
/* * */
/* & */
/* new [] */
/* delete [] */
/* operator *() */
/* 394-399 are reserved */
/* -- Type system and typemaps -- */
/* mostly used in directorout typemaps */
/* -- Fragments -- */
/* -- General code generation -- */
/* -- Doxygen comments -- */
/* -- Reserved (600-799) -- */
/* -- Language module specific warnings (700 - 899) -- */
/* please leave 700-719 free for D */
/* please leave 720-739 free for Scilab */
/* please leave 740-759 free for Python */
/* please leave 800-809 free for Ruby */
/* please leave 810-829 free for Java */
/* please leave 830-849 free for C# */
/* please leave 850-869 free for Modula 3 */
/* please leave 870-889 free for PHP */
/* please leave 890-899 free for Go */
/* -- User defined warnings (900 - 999) -- */
%endoffile
/* -----------------------------------------------------------------------------
* Auxiliary macros
* ----------------------------------------------------------------------------- */
/* Macro to define warning messages */
/* -----------------------------------------------------------------------------
* Typemap related warning messages
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Operator related warning messages
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Macros for keyword and built-in names
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Warning filter feature
* ----------------------------------------------------------------------------- */
%endoffile
%includefile "/usr/share/swig/4.0.0/swigfragments.swg" %beginfile
/* -----------------------------------------------------------------------------
* swigfragments.swg
*
* Common fragments
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Fragments for C header files
* ----------------------------------------------------------------------------- */
%fragment("<float.h>", "header") %{
#include <float.h>
%}
/* Default compiler options for gcc allow long_long but not LLONG_MAX.
* Define SWIG_NO_LLONG_MAX if this added limits support is not wanted. */
%fragment("<limits.h>", "header") %{
#include <limits.h>
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
# define LLONG_MAX __LONG_LONG_MAX__
# define LLONG_MIN (-LLONG_MAX - 1LL)
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
# endif
#endif
%}
%fragment("<math.h>", "header") %{
#include <math.h>
%}
%fragment("<stddef.h>", "header") %{
#include <stddef.h>
%}
%fragment("<stdio.h>", "header") %{
#include <stdio.h>
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
# ifndef snprintf
# define snprintf _snprintf
# endif
#endif
%}
%fragment("<stdlib.h>", "header") %{
#include <stdlib.h>
#ifdef _MSC_VER
# ifndef strtoull
# define strtoull _strtoui64
# endif
# ifndef strtoll
# define strtoll _strtoi64
# endif
#endif
%}
%fragment("<wchar.h>", "header") %{
#include <wchar.h>
#include <limits.h>
#ifndef WCHAR_MIN
# define WCHAR_MIN 0
#endif
#ifndef WCHAR_MAX
# define WCHAR_MAX 65535
#endif
%}
/* -----------------------------------------------------------------------------
* Fragments for C++ header files
* ----------------------------------------------------------------------------- */
%fragment("<algorithm>", "header") %{
#include <algorithm>
%}
%fragment("<stdexcept>", "header") %{
#include <stdexcept>
%}
%fragment("<string>", "header") %{
#include <string>
%}
%fragment("<memory>", "header") %{
#include <memory>
%}
%endoffile
/* -----------------------------------------------------------------------------
* Overloading support
* ----------------------------------------------------------------------------- */
/*
* Function/method overloading support. This is done through typemaps,
* but also involves a precedence level.
*/
/* Macro for overload resolution */
/* Macros for precedence levels */
/* -----------------------------------------------------------------------------
* Default handling of certain overloaded operators
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Default char * and C array typemaps
* ----------------------------------------------------------------------------- */
/* Set up the typemap for handling new return strings */
%typemap(newfree) char * "free($1);";
/* Default typemap for handling char * members */
%typemap(memberin) char * {
free($1);
if ($input) {
$1 = ($1_type) malloc(strlen((const char *)$input)+1);
strcpy((char *)$1, (const char *)$input);
} else {
$1 = 0;
}
}
%typemap(memberin,warning= "451:Setting a const char * variable may leak memory." ) const char * {
if ($input) {
$1 = ($1_type) malloc(strlen((const char *)$input)+1);
strcpy((char *)$1, (const char *)$input);
} else {
$1 = 0;
}
}
%typemap(globalin) char * {
free($1);
if ($input) {
$1 = ($1_type) malloc(strlen((const char *)$input)+1);
strcpy((char *)$1, (const char *)$input);
} else {
$1 = 0;
}
}
%typemap(globalin,warning= "451:Setting a const char * variable may leak memory." ) const char * {
if ($input) {
$1 = ($1_type) malloc(strlen((const char *)$input)+1);
strcpy((char *)$1, (const char *)$input);
} else {
$1 = 0;
}
}
/* Character array handling */
%typemap(memberin) char [ANY] {
if($input) {
strncpy((char*)$1, (const char *)$input, $1_dim0-1);
$1[$1_dim0-1] = 0;
} else {
$1[0] = 0;
}
}
%typemap(globalin) char [ANY] {
if($input) {
strncpy((char*)$1, (const char *)$input, $1_dim0-1);
$1[$1_dim0-1] = 0;
} else {
$1[0] = 0;
}
}
%typemap(memberin) char [] {
if ($input) strcpy((char *)$1, (const char *)$input);
else $1[0] = 0;
}
%typemap(globalin) char [] {
if ($input) strcpy((char *)$1, (const char *)$input);
else $1[0] = 0;
}
/* memberin/globalin typemap for arrays. */
%typemap(memberin) SWIGTYPE [ANY] {
size_t ii;
$1_basetype *b = ($1_basetype *) $1;
for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);
}
%typemap(globalin) SWIGTYPE [ANY] {
size_t ii;
$1_basetype *b = ($1_basetype *) $1;
for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii);
}
/* memberin/globalin typemap for double arrays. */
%typemap(memberin) SWIGTYPE [ANY][ANY] {
$basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input);
$basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1);
size_t ii = 0;
for (; ii < $1_dim0; ++ii) {
$basetype *ip = inp[ii];
$basetype *dp = dest[ii];
size_t jj = 0;
for (; jj < $1_dim1; ++jj) dp[jj] = ip[jj];
}
}
%typemap(globalin) SWIGTYPE [ANY][ANY] {
$basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input);
$basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1);
size_t ii = 0;
for (; ii < $1_dim0; ++ii) {
$basetype *ip = inp[ii];
$basetype *dp = dest[ii];
size_t jj = 0;
for (; jj < $1_dim1; ++jj) dp[jj] = ip[jj];
}
}
/* -----------------------------------------------------------------------------
* Runtime code
* ----------------------------------------------------------------------------- */
/* The SwigValueWrapper class */
/*
* This template wrapper is used to handle C++ objects that are passed or
* returned by value. This is necessary to handle objects that define
* no default-constructor (making it difficult for SWIG to properly declare
* local variables).
*
* The wrapper is used as follows. First consider a function like this:
*
* Vector cross_product(Vector a, Vector b)
*
* Now, if Vector is defined as a C++ class with no default constructor,
* code is generated as follows:
*
* Vector *wrap_cross_product(Vector *inarg1, Vector *inarg2) {
* SwigValueWrapper<Vector> arg1;
* SwigValueWrapper<Vector> arg2;
* SwigValueWrapper<Vector> result;
*
* arg1 = *inarg1;
* arg2 = *inarg2;
* ...
* result = cross_product(arg1,arg2);
* ...
* return new Vector(result);
* }
*
* In the wrappers, the template SwigValueWrapper simply provides a thin
* layer around a Vector *. However, it does this in a way that allows
* the object to be bound after the variable declaration (which is not possible
* with the bare object when it lacks a default constructor).
*
* An observant reader will notice that the code after the variable declarations
* is *identical* to the code used for classes that do define default constructors.
* Thus, this neat trick allows us to fix this special case without having to
* make massive changes to typemaps and other parts of the SWIG code generator.
*
* Note: this code is not included when SWIG runs in C-mode, when classes
* define default constructors, or when pointers and references are used.
* SWIG tries to avoid doing this except in very special circumstances.
*
* Note: This solution suffers from making a large number of copies
* of the underlying object. However, this is needed in the interest of
* safety and in order to cover all of the possible ways in which a value
* might be assigned. For example:
*
* arg1 = *inarg1; // Assignment from a pointer
* arg1 = Vector(1,2,3); // Assignment from a value
*
* The class offers a strong guarantee of exception safety.
* With regards to the implementation, the private SwigMovePointer nested class is
* a simple smart pointer with move semantics, much like std::auto_ptr.
*
* This wrapping technique was suggested by William Fulton and is henceforth
* known as the "Fulton Transform" :-).
*/
/* The swiglabels */
%insert("runtime") "swiglabels.swg"
%endoffile
%includefile "/usr/share/swig/4.0.0/python/python.swg" %beginfile
/* ------------------------------------------------------------
* python.swg
*
* Python configuration module.
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* Inner macros
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pymacros.swg" %beginfile
%includefile "/usr/share/swig/4.0.0/typemaps/swigmacros.swg" %beginfile
/* -----------------------------------------------------------------------------
* SWIG API. Portion only visible from SWIG
* ----------------------------------------------------------------------------- */
/*
This file implements the internal macros of the 'SWIG API', which
are useful to implement all the SWIG target languages.
Basic preprocessor macros:
--------------------------
%arg(Arg) Safe argument wrap
%str(Arg) Stringify the argument
%begin_block Begin an execution block
%end_block End an execution block
%block(Block) Execute Block as an execution block
%define_as(Def, Val) Define 'Def' as 'Val', expanding Def and Val first
%ifcplusplus(V1, V2) if C++ Mode; then V1; else V2; fi
Casting Operations:
-------------------
SWIG provides the following casting macros, which implement the
corresponding C++ casting operations:
%const_cast(a, Type) const_cast<Type >(a)
%static_cast(a, Type) static_cast<Type >(a)
%reinterpret_cast(a, Type) reinterpret_cast<Type >(a)
%numeric_cast(a, Type) static_cast<Type >(a)
%as_voidptr(a) const_cast<void *>(static_cast<const void *>(a))
%as_voidptrptr(a) reinterpret_cast<void **>(a)
or their C unsafe versions. In C++ we use the safe version unless
SWIG_NO_CPLUSPLUS_CAST is defined
Memory allocation:
------------------
These allocation/freeing macros are safe to use in C or C++ and
dispatch the proper new/delete/delete[] or free/malloc calls as
needed.
%new_instance(Type) Allocate a new instance of given Type
%new_copy(value,Type) Allocate and initialize a new instance with 'value'
%new_array(size,Type) Allocate a new array with given size and Type and zero initialize
%new_copy_array(cptr,size,Type) Allocate and initialize a new array from 'cptr'
%delete(cptr) Delete an instance
%delete_array(cptr) Delete an array
Auxiliary loop macros:
----------------------
%formacro(Macro, Args...) or %formacro_1(Macro, Args...)
for i in Args
do
Macro($i)
done
%formacro_2(Macro2, Args...)
for i,j in Args
do
Macro2($i, $j)
done
Flags and conditional macros:
-----------------------------
%mark_flag(flag)
flag := True
%evalif(flag,expr)
if flag; then
expr
fi
%evalif_2(flag1 flag2,expr)
if flag1 and flag2; then
expr
fi
*/
/* -----------------------------------------------------------------------------
* Basic preprocessor macros
* ----------------------------------------------------------------------------- */
/* define a new macro */
/* include C++ or else value */
/* insert the SWIGVERSION in the interface and the wrapper code */
%insert("header") {
#define SWIGVERSION 0x040000
#define SWIG_VERSION SWIGVERSION
}
/* -----------------------------------------------------------------------------
* Casting operators
* ----------------------------------------------------------------------------- */
%insert("header") {
#define SWIG_as_voidptr(a) (void *)((const void *)(a))
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
}
/* -----------------------------------------------------------------------------
* Allocating/freeing elements
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* SWIG names and mangling
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Auxiliary loop macros
* ----------------------------------------------------------------------------- */
/* for loop for macro with one argument */
/* for loop for macro with one argument */
/* for loop for macro with two arguments */
/* for loop for macro with two arguments */
/* -----------------------------------------------------------------------------
* SWIG flags
* ----------------------------------------------------------------------------- */
/*
mark a flag, ie, define a macro name but ignore it in
the interface.
the flag can be later used with %evalif
*/
/*
%evalif and %evalif_2 are use to evaluate or process
an expression if the given predicate is 'true' (1).
*/
%endoffile
%endoffile
/* ------------------------------------------------------------
* The runtime part
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyruntime.swg" %beginfile
%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 <math.h>
#endif
#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
/* Use debug wrappers with the Python release dll */
# undef _DEBUG
# include <Python.h>
# define _DEBUG 1
#else
# include <Python.h>
#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 */
%endoffile
/* ------------------------------------------------------------
* Special user directives
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyuserdir.swg" %beginfile
/* -------------------------------------------------------------------------
* Special user directives
* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* shadow code */
/* ------------------------------------------------------------------------- */
/*
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
*/
/* ------------------------------------------------------------------------- */
/*
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.
*/
/* ------------------------------------------------------------------------- */
/*
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.
*/
/* ------------------------------------------------------------------------- */
/*
Support for the old %callback directive name
*/
/* ------------------------------------------------------------------------- */
/*
Thread support - Advance control
*/
/* ------------------------------------------------------------------------- */
/*
Implicit Conversion using the C++ constructor mechanism
*/
/* ------------------------------------------------------------------------- */
/*
Enable keywords parameters
*/
/* ------------------------------------------------------------------------- */
/*
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
*/
/* ------------------------------------------------------------------------- */
/*
%extend_smart_pointer extend the smart pointer support.
For example, if you have a smart pointer as:
template <class Type> class RCPtr {
public:
...
RCPtr(Type *p);
Type * operator->() const;
...
};
you use the %extend_smart_pointer directive as:
%extend_smart_pointer(RCPtr<A>);
%template(RCPtr_A) RCPtr<A>;
then, if you have something like:
RCPtr<A> make_ptr();
int foo(A *);
you can do the following:
a = make_ptr();
b = foo(a);
ie, swig will accept a RCPtr<A> object where a 'A *' is
expected.
Also, when using vectors
%extend_smart_pointer(RCPtr<A>);
%template(RCPtr_A) RCPtr<A>;
%template(vector_A) std::vector<RCPtr<A> >;
you can type
a = A();
v = vector_A(2)
v[0] = a
ie, an 'A *' object is accepted, via implicit conversion,
where a RCPtr<A> object is expected. Additionally
x = v[0]
returns (and sets 'x' as) a copy of v[0], making reference
counting possible and consistent.
*/
%endoffile
/* ------------------------------------------------------------
* Typemap specializations
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pytypemaps.swg" %beginfile
/* ------------------------------------------------------------
* Typemap specializations for Python
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* Fragment section
* ------------------------------------------------------------ */
/* Include fundamental fragment definitions */
%includefile "/usr/share/swig/4.0.0/typemaps/fragments.swg" %beginfile
/*
Fragments
=========
See the "Typemap fragments" section in the documentation for understanding
fragments. Below is some info on how fragments and automatic type
specialization is used.
Macros that make the automatic generation of typemaps easier are provided.
Consider the following code:
%fragment(SWIG_From_frag(bool), "header") {
static PyObject*
SWIG_From_dec(bool)(bool value)
{
PyObject *obj = value ? Py_True : Py_False;
Py_INCREF(obj);
return obj;
}
}
%typemap(out, fragment=SWIG_From_frag(bool)) bool {
$result = SWIG_From(bool)($1));
}
Here the macros
SWIG_From_frag => fragment
SWIG_From_dec => declaration
SWIG_From => call
allow you to define/include a fragment, and declare and call the
'from-bool' method as needed. In the simpler case, these macros
just return something like
SWIG_From_frag(bool) => "SWIG_From_bool"
SWIG_From_dec(bool) => SWIG_From_bool
SWIG_From(bool) => SWIG_From_bool
But they are specialized for the different languages requirements,
such as perl or tcl that requires passing the interpreter pointer,
and also they can manage C++ ugly types, for example:
SWIG_From_frag(std::complex<double>) => "SWIG_From_std_complex_Sl_double_Sg_"
SWIG_From_dec(std::complex<double>) => SWIG_From_std_complex_Sl_double_Sg_
SWIG_From(std::complex<double>) => SWIG_From_std_complex_Sl_double_Sg_
Hence, to declare methods to use with typemaps, always use the
SWIG_From* macros. In the same way, the SWIG_AsVal* and SWIG_AsPtr*
set of macros are provided.
*/
/* -----------------------------------------------------------------------------
* Define the basic macros to 'normalize' the type fragments
* ----------------------------------------------------------------------------- */
/* ------------------------------------------------------------
* common fragments
* ------------------------------------------------------------ */
%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{
/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
#ifndef SWIG_isfinite
/* isfinite() is a macro for C99 */
# if defined(isfinite)
# define SWIG_isfinite(X) (isfinite(X))
# elif defined(__cplusplus) && __cplusplus >= 201103L
/* Use a template so that this works whether isfinite() is std::isfinite() or
* in the global namespace. The reality seems to vary between compiler
* versions.
*
* Make sure namespace std exists to avoid compiler warnings.
*
* extern "C++" is required as this fragment can end up inside an extern "C" { } block
*/
namespace std { }
extern "C++" template<typename T>
inline int SWIG_isfinite_func(T x) {
using namespace std;
return isfinite(x);
}
# define SWIG_isfinite(X) (SWIG_isfinite_func(X))
# elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
# define SWIG_isfinite(X) (__builtin_isfinite(X))
# elif defined(__clang__) && defined(__has_builtin)
# if __has_builtin(__builtin_isfinite)
# define SWIG_isfinite(X) (__builtin_isfinite(X))
# endif
# elif defined(_MSC_VER)
# define SWIG_isfinite(X) (_finite(X))
# elif defined(__sun) && defined(__SVR4)
# include <ieeefp.h>
# define SWIG_isfinite(X) (finite(X))
# endif
#endif
%}
%fragment("SWIG_Float_Overflow_Check","header",fragment="<float.h>,SWIG_isfinite") %{
/* Accept infinite as a valid float value unless we are unable to check if a value is finite */
#ifdef SWIG_isfinite
# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X))
#else
# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX))
#endif
%}
/* -----------------------------------------------------------------------------
* special macros for fragments
* ----------------------------------------------------------------------------- */
/* Macros to derive numeric types */
/* Macro for 'signed long' derived types */
/* Macro for 'unsigned long' derived types */
/* Macro for floating point derived types (original macro) */
/* Macro for floating point derived types */
/* Macros for missing fragments */
%endoffile
/* Look for user fragments file. */
%includefile "/usr/share/swig/4.0.0/python/pyfragments.swg" %beginfile
/*
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)
{
<your code here>;
}
}
this will replace the code used to retrieve an integer value for all
the typemaps that need it, including:
int, std::vector<int>, std::list<std::pair<int,int> >, etc.
*/
%endoffile
/* Python fragments for fundamental types */
%includefile "/usr/share/swig/4.0.0/python/pyprimtypes.swg" %beginfile
/* ------------------------------------------------------------
* Primitive Types
* ------------------------------------------------------------ */
/* boolean */
%fragment("SWIG_" "From" "_" {bool},"header") {
SWIGINTERNINLINE PyObject*
SWIG_From_bool (bool value)
{
return PyBool_FromLong(value ? 1 : 0);
}
}
%fragment("SWIG_" "AsVal" "_" {bool},"header",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_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;
}
}
/* int */
%fragment("SWIG_" "From" "_" {int},"header") {
SWIGINTERNINLINE PyObject*
SWIG_From_int (int value)
{
return PyInt_FromLong((long) value);
}
}
/* unsigned int */
%fragment("SWIG_" "From" "_" {unsigned int},"header") {
SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_int (unsigned int value)
{
return PyInt_FromSize_t((size_t) value);
}
}
/* long */
%fragment("SWIG_" "From" "_" {long},"header") {
#define SWIG_From_long PyInt_FromLong
}
%fragment("SWIG_" "AsVal" "_" {long},"header",
fragment="SWIG_CanCastAsInteger") {
SWIGINTERN int
SWIG_AsVal_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" "_" {unsigned long},"header",
fragment="SWIG_" "From" "_" {long}) {
SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long (unsigned long value)
{
return (value > LONG_MAX) ?
PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value));
}
}
%fragment("SWIG_" "AsVal" "_" {unsigned long},"header",
fragment="SWIG_CanCastAsInteger") {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_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" "_" {long long},"header",
fragment="SWIG_LongLongAvailable") {
#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERNINLINE PyObject*
SWIG_From_long_SS_long (long long value)
{
return ((value < LONG_MIN) || (value > LONG_MAX)) ?
PyLong_FromLongLong(value) : PyInt_FromLong((long)(value));
}
#endif
}
%fragment("SWIG_" "AsVal" "_" {long long},"header",
fragment="SWIG_" "AsVal" "_" {long},
fragment="SWIG_CanCastAsInteger",
fragment="SWIG_LongLongAvailable") {
#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERN int
SWIG_AsVal_long_SS_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" "_" {unsigned long long},"header",
fragment="SWIG_LongLongAvailable") {
#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
{
return (value > LONG_MAX) ?
PyLong_FromUnsignedLongLong(value) : PyInt_FromLong((long)(value));
}
#endif
}
%fragment("SWIG_" "AsVal" "_" {unsigned long long},"header",
fragment="SWIG_" "AsVal" "_" {unsigned long},
fragment="SWIG_CanCastAsInteger",
fragment="SWIG_LongLongAvailable") {
#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERN int
SWIG_AsVal_unsigned_SS_long_SS_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_SS_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" "_" {double},"header") {
#define SWIG_From_double PyFloat_FromDouble
}
%fragment("SWIG_" "AsVal" "_" {double},"header") {
SWIGINTERN int
SWIG_AsVal_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;
}
}
%endoffile
/* Python fragments for char* strings */
%includefile "/usr/share/swig/4.0.0/python/pystrings.swg" %beginfile
/* ------------------------------------------------------------
* 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
PyBytes_AsStringAndSize(obj, &cstr, &len);
#else
PyString_AsStringAndSize(obj, &cstr, &len);
#endif
if (cptr) {
if (alloc) {
if (*alloc == SWIG_NEWOBJ) {
*cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
*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 = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
}
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((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void();
} else {
#if PY_VERSION_HEX >= 0x03000000
#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size));
#else
return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape");
#endif
#else
return PyString_FromStringAndSize(carray, (Py_ssize_t)(size));
#endif
}
} else {
return SWIG_Py_Void();
}
}
}
%endoffile
/* Backward compatibility output helper */
%fragment("t_output_helper","header") %{
#define t_output_helper SWIG_Python_AppendOutput
%}
/* ------------------------------------------------------------
* Unified typemap section
* ------------------------------------------------------------ */
/* directors are supported in Python */
/* Python types */
/* Python allows implicit conversion */
/* Overload of the output/constant/exception/dirout handling */
/* append output */
/* set constant */
/* raise */
/* Include the unified typemap library */
%includefile "/usr/share/swig/4.0.0/typemaps/swigtypemaps.swg" %beginfile
/* -----------------------------------------------------------------------------
* swigtypemaps.swg
*
* Unified Typemap Library frontend
* ----------------------------------------------------------------------------- */
/*
This file provides the frontend to the Unified Typemap Library.
When using this library in a SWIG target language, you need to
define a minimum set of fragments, specialize a couple of macros,
and then include this file.
Typically you will create a 'mytypemaps.swg' file in each target
language, where you will have the following sections:
=== mytypemaps.swg ===
// Fragment section
%include <typemaps/fragments.swg>
<include target language fragments>
// Unified typemap section
<specialized the typemap library macros>
%include <typemaps/swigtypemaps.swg>
// Local typemap section
<add/replace extra target language typemaps>
=== mytypemaps.swg ===
While we add more docs, please take a look at the following cases
to see how you specialized the unified typemap library for a new
target language:
Lib/python/pytypemaps.swg
Lib/tcl/tcltypemaps.swg
Lib/ruby/rubytypemaps.swg
Lib/perl5/perltypemaps.swg
*/
/* -----------------------------------------------------------------------------
* Language specialization section.
*
* Tune these macros for each language as needed.
* ----------------------------------------------------------------------------- */
/*
The SWIG target language object must be provided.
For example in python you define:
#define SWIG_Object PyObject *
*/
/*==== flags for new/convert methods ====*/
/*==== set output ====*/
/* simple set output operation */
/*==== set variable output ====*/
/* simple set varoutput operation */
/*==== append output ====*/
/* simple append operation */
/*==== set constant ====*/
/* simple set constant operation */
/*==== raise an exception ====*/
/* simple raise operation */
/*==== director output exception ====*/
/* -----------------------------------------------------------------------------
* Language independent definitions
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* All the typemaps
* ----------------------------------------------------------------------------- */
%includefile "/usr/share/swig/4.0.0/typemaps/exception.swg" %beginfile
/* -----------------------------------------------------------------------------
* exceptions.swg
*
* This SWIG library file provides language independent exception handling
* ----------------------------------------------------------------------------- */
/* macros for error manipulation */
/* setting an error */
%insert("runtime") {
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
}
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/swigtype.swg" %beginfile
/* -----------------------------------------------------------------------------
* --- Input arguments ---
* ----------------------------------------------------------------------------- */
/* Pointers and arrays */
%typemap(in, noblock=1) SWIGTYPE *(void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp,$descriptor, $disown | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($ltype)(argp);
}
%typemap(freearg) SWIGTYPE * "";
%typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp,$descriptor, $disown | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($ltype)(argp);
}
%typemap(freearg) SWIGTYPE [] "";
%typemap(in, noblock=1) SWIGTYPE *const& (void *argp = 0, int res = 0, $*1_ltype temp) {
res = SWIG_ConvertPtr($input, &argp, $*descriptor, $disown | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(argp);
$1 = ($1_ltype)(&temp);
}
%typemap(freearg) SWIGTYPE *const& "";
/* Reference */
%typemap(in, noblock=1) SWIGTYPE & (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'"); }
$1 = ($ltype)(argp);
}
%typemap(freearg) SWIGTYPE & "";
%typemap(in,noblock=1) const SWIGTYPE & (void *argp, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'"); }
$1 = ($ltype)(argp);
}
/* Rvalue reference */
%typemap(in, noblock=1) SWIGTYPE && (void *argp = 0, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'"); }
$1 = ($ltype)(argp);
}
%typemap(freearg) SWIGTYPE && "";
%typemap(in,noblock=1) const SWIGTYPE && (void *argp, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'"); }
$1 = ($ltype)(argp);
}
/* By value */
%typemap(in) SWIGTYPE (void *argp, int res = 0) {
res = SWIG_ConvertPtr($input, &argp, $&descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
if (!argp) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
} else {
$1 = *(($&ltype)(argp));
}
}
/* -----------------------------------------------------------------------------
* --- Output arguments ---
* ----------------------------------------------------------------------------- */
/* Pointers, references */
%typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE[] {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, $owner | 0 );
}
%typemap(out, noblock=1) SWIGTYPE *const& {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(*$1), $*descriptor, $owner | 0 );
}
/* Return by value */
%typemap(out, noblock=1) SWIGTYPE {
$result = SWIG_NewPointerObj(($ltype *)memcpy(($ltype *)calloc(1,sizeof($ltype)),&$1,sizeof($ltype)), $&descriptor, SWIG_POINTER_OWN | 0 );
}
/* -----------------------------------------------------------------------------
* --- Variable input ---
* ----------------------------------------------------------------------------- */
/* memberin/globalin/varin, for fix arrays. */
%typemap(memberin) SWIGTYPE [ANY] {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)$input + ii);
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
%typemap(globalin) SWIGTYPE [ANY] {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)$input + ii);
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
%typemap(varin) SWIGTYPE [ANY] {
$basetype *inp = 0;
int res = SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&inp), $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
} else if (inp) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) *($1_basetype *)&$1[ii] = *(($1_basetype *)inp + ii);
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
/* memberin/globalin/varin, for fix double arrays. */
%typemap(memberin) SWIGTYPE [ANY][ANY] {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) {
if ($input[ii]) {
size_t jj = 0;
for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj];
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
%typemap(globalin) SWIGTYPE [ANY][ANY] {
if ($input) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) {
if ($input[ii]) {
size_t jj = 0;
for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj];
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
%typemap(varin) SWIGTYPE [ANY][ANY] {
$basetype (*inp)[$1_dim1] = 0;
int res = SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&inp), $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
} else if (inp) {
size_t ii = 0;
for (; ii < (size_t)$1_dim0; ++ii) {
if (inp[ii]) {
size_t jj = 0;
for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = inp[ii][jj];
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
} else {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
}
/* Pointers, references, and variable size arrays */
%typemap(varin,warning= "454:Setting a pointer/reference variable may leak memory." ) SWIGTYPE * {
void *argp = 0;
int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(argp);
}
%typemap(varin,noblock=1,warning="462:Unable to set dimensionless array variable") SWIGTYPE []
{
SWIG_exception_fail(SWIG_ArgError(SWIG_AttributeError), "in variable '""read-only $name""' of type '""$type""'");
}
%typemap(varin,warning= "454:Setting a pointer/reference variable may leak memory." ) SWIGTYPE & {
void *argp = 0;
int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if (!argp) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
$1 = *(($ltype)(argp));
}
%typemap(varin,warning= "454:Setting a pointer/reference variable may leak memory." ) SWIGTYPE && {
void *argp = 0;
int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if (!argp) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
}
$1 = *(($ltype)(argp));
}
%typemap(varin) SWIGTYPE {
void *argp = 0;
int res = SWIG_ConvertPtr($input, &argp, $&descriptor, 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if (!argp) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""$name""' of type '""$type""'");
} else {
$1 = *(($&type)(argp));
}
}
/* -----------------------------------------------------------------------------
* --- Variable output ---
* ----------------------------------------------------------------------------- */
/* Pointers and arrays */
%typemap(varout, noblock=1) SWIGTYPE * {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, 0 );
}
%typemap(varout, noblock=1) SWIGTYPE [] {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, 0 );
}
/* References */
%typemap(varout, noblock=1) SWIGTYPE & {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $descriptor, 0 );
}
%typemap(varout, noblock=1) SWIGTYPE && {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $descriptor, 0 );
}
/* Value */
%typemap(varout, noblock=1) SWIGTYPE {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $&descriptor, 0 );
}
/* ------------------------------------------------------------
* --- Typechecking rules ---
* ------------------------------------------------------------ */
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE * {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE *const& {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $*descriptor, 0);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE & {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE && {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) const SWIGTYPE & {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) const SWIGTYPE && {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
%typemap(typecheck,precedence= 0 ,noblock=1) SWIGTYPE {
void *vptr = 0;
int res = SWIG_ConvertPtr($input, &vptr, $&descriptor, SWIG_POINTER_NO_NULL);
$1 = SWIG_CheckState(res);
}
/* -----------------------------------------------------------------------------
* --- Director typemaps --- *
* ----------------------------------------------------------------------------- */
/* directorin */
%typemap(directorin,noblock=1) SWIGTYPE {
$input = SWIG_NewPointerObj(SWIG_as_voidptr(new $1_ltype((const $1_ltype &)$1)), $&descriptor, SWIG_POINTER_OWN | 0 );
}
%typemap(directorin,noblock=1) SWIGTYPE * {
$input = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, 0 );
}
%typemap(directorin,noblock=1) SWIGTYPE *const& {
$input = SWIG_NewPointerObj(SWIG_as_voidptr($1), $*descriptor, 0 );
}
%typemap(directorin,noblock=1) SWIGTYPE & {
$input = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $descriptor, 0 );
}
%typemap(directorin,noblock=1) SWIGTYPE && {
$input = SWIG_NewPointerObj(SWIG_as_voidptr(&$1_name), $descriptor, 0 );
}
/* directorout */
%typemap(directorout,noblock=1) SWIGTYPE (void * swig_argp, int swig_res = 0) {
swig_res = SWIG_ConvertPtr($input,&swig_argp,$&descriptor, 0 );
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = *(($&ltype)(swig_argp));
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." )
SWIGTYPE *(void *swig_argp, int swig_res, swig_owntype own) {
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, 0 | SWIG_POINTER_DISOWN, &own);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($ltype)(swig_argp);
swig_acquire_ownership_obj(SWIG_as_voidptr($result), own /* & TODO: SWIG_POINTER_OWN */);
}
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE * {
if (director) {
SWIG_AcquirePtr($result, director->swig_release_ownership(SWIG_as_voidptr($input)));
}
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." )
SWIGTYPE *const&(void *swig_argp, int swig_res, swig_owntype own) {
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $*descriptor, 0 | SWIG_POINTER_DISOWN, &own);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$1_ltype swig_temp = new $*1_ltype(($*1_ltype)swig_argp);
swig_acquire_ownership(swig_temp);
$result = swig_temp;
}
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE *const& {
if (director) {
SWIG_AcquirePtr($result, director->swig_release_ownership(SWIG_as_voidptr(*$input)));
}
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." )
SWIGTYPE &(void *swig_argp, int swig_res, swig_owntype own) {
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, 0 | SWIG_POINTER_DISOWN, &own);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
if (!swig_argp) { Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ValueError), "invalid null reference " "in output value of type '""$type""'"); }
$result = ($ltype)(swig_argp);
swig_acquire_ownership_obj(SWIG_as_voidptr($result), own /* & TODO: SWIG_POINTER_OWN */);
}
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE & {
if (director) {
SWIG_AcquirePtr($result, director->swig_release_ownership(SWIG_as_voidptr($input)));
}
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." )
SWIGTYPE &&(void *swig_argp, int swig_res, swig_owntype own) {
swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, 0 | SWIG_POINTER_DISOWN, &own);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
if (!swig_argp) { Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ValueError), "invalid null reference " "in output value of type '""$type""'"); }
$result = ($ltype)(swig_argp);
swig_acquire_ownership_obj(SWIG_as_voidptr($result), own /* & TODO: SWIG_POINTER_OWN */);
}
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE && {
if (director) {
SWIG_AcquirePtr($result, director->swig_release_ownership(SWIG_as_voidptr($input)));
}
}
/* ------------------------------------------------------------
* --- Constants ---
* ------------------------------------------------------------ */
%typemap(constcode,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE &&, SWIGTYPE [] {
SWIG_Python_SetConstant(d, "$symname",SWIG_NewPointerObj(SWIG_as_voidptr($value),$descriptor, 0 ));
}
%typemap(constcode,noblock=1) SWIGTYPE {
SWIG_Python_SetConstant(d, "$symname",SWIG_NewPointerObj(SWIG_as_voidptr(&$value),$&descriptor, 0 ));
}
/* ------------------------------------------------------------
* --- Exception handling ---
* ------------------------------------------------------------ */
%typemap(throws,noblock=1) SWIGTYPE {
SWIG_Python_Raise(SWIG_NewPointerObj(($ltype *)memcpy(($ltype *)calloc(1,sizeof($ltype)),&$1,sizeof($ltype)),$&descriptor,SWIG_POINTER_OWN), "$type", $&descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) SWIGTYPE * {
SWIG_Python_Raise(SWIG_NewPointerObj(SWIG_as_voidptr($1),$descriptor,0), "$type", $descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) SWIGTYPE [ANY] {
SWIG_Python_Raise(SWIG_NewPointerObj(SWIG_as_voidptr($1),$descriptor,0), "$type", $descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) SWIGTYPE & {
SWIG_Python_Raise(SWIG_NewPointerObj(SWIG_as_voidptr(&$1),$descriptor,0), "$type", $descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) SWIGTYPE && {
SWIG_Python_Raise(SWIG_NewPointerObj(SWIG_as_voidptr(&$1),$descriptor,0), "$type", $descriptor); SWIG_fail;
}
%typemap(throws,noblock=1) (...) {
SWIG_exception_fail(SWIG_RuntimeError,"unknown exception");
}
/* ------------------------------------------------------------
* --- CLASS::* typemaps ---
* ------------------------------------------------------------ */
%typemap(in) SWIGTYPE (CLASS::*) {
int res = SWIG_ConvertMember($input, SWIG_as_voidptr(&$1), sizeof($type),$descriptor);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
}
%typemap(out,noblock=1) SWIGTYPE (CLASS::*) {
$result = SWIG_NewMemberObj(SWIG_as_voidptr(&$1), sizeof($type), $descriptor);
}
%typemap(varin) SWIGTYPE (CLASS::*) {
int res = SWIG_ConvertMember($input,SWIG_as_voidptr(&$1), sizeof($type), $descriptor);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
}
%typemap(varout,noblock=1) SWIGTYPE (CLASS::*) {
$result = SWIG_NewMemberObj(SWIG_as_voidptr(&$1), sizeof($type), $descriptor);
}
%typemap(constcode,noblock=1) SWIGTYPE (CLASS::*) {
SWIG_Python_SetConstant(d, "$symname",SWIG_NewMemberObj(SWIG_as_voidptr(&$value), sizeof($type), $descriptor));
}
/* directorin */
%typemap(directorin,noblock=1) SWIGTYPE (CLASS::*) {
$input = SWIG_NewMemberObj(SWIG_as_voidptr(&$1), sizeof($type), $descriptor);
}
/* directorout */
%typemap(directorout) SWIGTYPE (CLASS::*) {
int swig_res = SWIG_ConvertMember($input,SWIG_as_voidptr(&$result), sizeof($type), $descriptor);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
}
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* ------------------------------------------------------------
* --- function ptr typemaps ---
* ------------------------------------------------------------ */
/*
ISO C++ doesn't allow direct casting of a function ptr to a object
ptr. So, maybe the ptr sizes are not the same, and we need to take
some providences.
*/
%typemap(in) SWIGTYPE ((*)(ANY)) {
int res = SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
}
%typemap(typecheck, precedence= 0 ,noblock=1) SWIGTYPE ((*)(ANY)) {
void *ptr = 0;
int res = SWIG_ConvertFunctionPtr($input, &ptr, $descriptor);
$1 = SWIG_CheckState(res);
}
%typemap(out, noblock=1) SWIGTYPE ((*)(ANY)) {
$result = SWIG_NewFunctionPtrObj((void *)($1), $descriptor);
}
%typemap(varin) SWIGTYPE ((*)(ANY)) {
int res = SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
}
%typemap(varout,noblock=1) SWIGTYPE ((*)(ANY)) {
$result = SWIG_NewFunctionPtrObj((void *)($1), $descriptor);
}
%typemap(constcode, noblock=1) SWIGTYPE ((*)(ANY)){
SWIG_Python_SetConstant(d, "$symname",SWIG_NewFunctionPtrObj((void *)$value, $descriptor));
}
%typemap(constcode) SWIGTYPE ((* const)(ANY)) = SWIGTYPE ((*)(ANY));
/* directorin */
%typemap(directorin,noblock=1) SWIGTYPE ((*)(ANY)) {
$input = SWIG_NewFunctionPtrObj((void*)($1), $descriptor);
}
/* directorout */
%typemap(directorout) SWIGTYPE ((*)(ANY)) {
int swig_res = SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
}
%apply SWIGTYPE ((*)(ANY)) { SWIGTYPE ((* const)(ANY)) }
%apply SWIGTYPE * { SWIGTYPE *const }
/* ------------------------------------------------------------
* --- Special typemaps ---
* ------------------------------------------------------------ */
/* DISOWN typemap */
%typemap(in, noblock=1) SWIGTYPE *DISOWN (int res = 0) {
res = SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
}
%typemap(varin) SWIGTYPE *DISOWN {
void *temp = 0;
int res = SWIG_ConvertPtr($input, &temp, $descriptor, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype) temp;
}
/* DYNAMIC typemap */
%typemap(out,noblock=1) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIG_TypeDynamicCast($descriptor, SWIG_as_voidptrptr(&$1)), $owner | 0 );
}
/* INSTANCE typemap */
%typemap(out,noblock=1) SWIGTYPE INSTANCE {
$result = SWIG_NewInstanceObj(($1_ltype *)memcpy(($1_ltype *)calloc(1,sizeof($1_ltype)),&$1,sizeof($1_ltype)), $&1_descriptor, SWIG_POINTER_OWN | 0 );
}
%typemap(out,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE &INSTANCE, SWIGTYPE INSTANCE[] {
$result = SWIG_NewInstanceObj(SWIG_as_voidptr($1), $1_descriptor, $owner | 0 );
}
%typemap(varout,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE INSTANCE[] {
$result = SWIG_NewInstanceObj(SWIG_as_voidptr($1), $1_descriptor, 0 );
}
%typemap(varout,noblock=1) SWIGTYPE &INSTANCE {
$result = SWIG_NewInstanceObj(SWIG_as_voidptr($1), $1_descriptor, 0 );
}
%typemap(varout,noblock=1) SWIGTYPE INSTANCE {
$result = SWIG_NewInstanceObj(SWIG_as_voidptr(&$1), $&1_descriptor, 0 );
}
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/void.swg" %beginfile
/* ------------------------------------------------------------
* Void * - Accepts any kind of pointer
* ------------------------------------------------------------ */
/* in */
%typemap(in,noblock=1) void * (int res) {
res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1), 0, $disown);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
}
%typemap(freearg) void * "";
%typemap(in,noblock=1) void * const& ($*ltype temp = 0, int res) {
res = SWIG_ConvertPtr($input, SWIG_as_voidptrptr(&temp), 0, $disown);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "Stype""'");
}
$1 = &temp;
}
%typemap(freearg) void * const& "";
/* out */
%typemap(out,noblock=1) void { $result = SWIG_Py_Void(); }
/* varin */
%typemap(varin) void * {
void *temp = 0;
int res = SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($1_ltype) temp;
}
/* typecheck */
%typemap(typecheck, precedence= 10 ,noblock=1) void *
{
void *ptr = 0;
int res = SWIG_ConvertPtr($input, &ptr, 0, 0);
$1 = SWIG_CheckState(res);
}
/* directorin */
%typemap(directorin,noblock=1) void *, void const*, void *const, void const *const,
void const *&, void *const &, void const *const & {
$input = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor, 0 );
}
/* directorout */
%typemap(directorout,noblock=1) void * (void *argp, int res) {
res = SWIG_ConvertPtr($input, &argp, 0, 0);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
$result = ($ltype)(argp);
}
%typemap(directorout,noblock=1,warning= "473:Returning a pointer or reference in a director method is not recommended." ) void * const& (void *argp, int res) {
res = SWIG_ConvertPtr($input, &argp, 0, $disown);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
static $*ltype temp = ($*ltype)(argp);
$result = &temp;
}
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/swigobject.swg" %beginfile
/* ------------------------------------------------------------
* Language Object * - Just pass straight through unmodified
* ------------------------------------------------------------ */
%typemap(in) PyObject * "$1 = $input;";
%typemap(in,noblock=1) PyObject * const & ($*ltype temp)
{
temp = ($*ltype)($input);
$1 = &temp;
}
%typemap(out,noblock=1) PyObject * {
$result = $1;
}
%typemap(out,noblock=1) PyObject * const & {
$result = *$1;
}
%typemap(typecheck, precedence= 5000 ) PyObject * "$1 = ($input != 0);";
%typemap(throws,noblock=1) PyObject * {
SWIG_Python_Raise($1, "$type", 0); SWIG_fail;
}
%typemap(constcode,noblock=1) PyObject * {
SWIG_Python_SetConstant(d, "$symname",$value);
}
%typemap(directorin) PyObject * "$input = $1;";
%typemap(directorout) PyObject * "$result = $input;";
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/valtypes.swg" %beginfile
/*---------------------------------------------------------------------
* Value typemaps (Type, const Type&) for value types, such as
* fundamental types (int, double), that define the AsVal/From
* methods.
*
* To apply them, just use one of the following macros:
*
* %typemaps_from(FromMeth, FromFrag, Type)
* %typemaps_asval(CheckCode, AsValMeth, AsValFrag, Type)
* %typemaps_asvalfrom(CheckCode, AsValMeth, FromMeth, AsValFrag, FromFrag, Type)
*
* or the simpler and normalize form:
*
* %typemaps_asvalfromn(CheckCode, Type)
*
* Also, you can use the individual typemap definitions:
*
* %value_in_typemap(asval_meth,frag,Type)
* %value_varin_typemap(asval_meth,frag,Type)
* %value_typecheck_typemap(checkcode,asval_meth,frag,Type)
* %value_directorout_typemap(asval_meth,frag,Type)
*
* %value_out_typemap(from_meth,frag,Type)
* %value_varout_typemap(from_meth,frag,Type)
* %value_constcode_typemap(from_meth,frag,Type)
* %value_directorin_typemap(from_meth,frag,Type)
* %value_throws_typemap(from_meth,frag,Type)
*
*---------------------------------------------------------------------*/
/* in */
/* out */
/* varin */
/* varout */
/* constant installation code */
/* directorin */
/* directorout */
/* throws */
/* typecheck */
/*---------------------------------------------------------------------
* typemap definition for types with AsVal methods
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with from method
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with alval/from method
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with for 'normalized' asval/from methods
*---------------------------------------------------------------------*/
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/ptrtypes.swg" %beginfile
/* -----------------------------------------------------------------------------
* ptrtypes.swg
*
* Value typemaps (Type, const Type&) for "Ptr" types, such as swig
* wrapped classes, that define the AsPtr/From methods
*
* To apply them, just use one of the following macros:
*
* %typemaps_asptr(CheckCode, AsPtrMeth, AsPtrFrag, Type)
* %typemaps_asptrfrom(CheckCode, AsPtrMeth, FromMeth, AsPtrFrag, FromFrag, Type)
*
* or the simpler and normalize form:
*
* %typemaps_asptrfromn(CheckCode, Type)
*
* Also, you can use the individual typemap definitions:
*
* %ptr_in_typemap(asptr_meth,frag,Type)
* %ptr_varin_typemap(asptr_meth,frag,Type)
* %ptr_typecheck_typemap(check,asptr_meth,frag,Type)
* %ptr_directorout_typemap(asptr_meth,frag,Type)
* ----------------------------------------------------------------------------- */
/* in */
/* varin */
/* directorout */
/* typecheck */
/*---------------------------------------------------------------------
* typemap definition for types with asptr method
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with asptr/from methods
*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------
* typemap definition for types with for 'normalized' asptr/from methods
*---------------------------------------------------------------------*/
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/inoutlist.swg" %beginfile
/* ------------------------------------------------------------
*
* Define the IN/OUTPUT typemaps assuming the output parameters are
* returned in a list, i.e., they are not directly modified.
*
* The user should provide the %append_output(result, obj) method,
* via a macro, which append a particular object to the result.
*
*
* In Tcl, for example, the file is used as:
*
* #define %append_output(obj) Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),obj);
* %include <typemaps/inoutlist.swg>
*
* while in Python it is used as:
*
* #define %append_output(obj) $result = SWIG_Python_AppendResult($result, obj)
* %include <typemaps/inoutlist.swg>
*
* where the method SWIG_Python_AppendResult is defined inside the
* %append_output fragment.
*
* If you forget to define %append_output, this file will generate
* an error.
*
* ------------------------------------------------------------ */
//
// Uncomment the following definition if you don't want the in/out
// typemaps by default, ie, you prefer to use typemaps.i.
//
//#define SWIG_INOUT_NODEF
//
// Use the following definition to enable the INPUT parameters to
// accept both 'by value' and 'pointer' objects.
//
// ------------------------------------------------------------------------
// 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.
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 :
double fadd(double *INPUT, double *INPUT);
or you can use the %apply directive :
%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 list.
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 :
double modf(double x, double *OUTPUT);
or you can use the %apply directive :
%apply double *OUTPUT { double *ip };
double modf(double x, double *ip);
The output of the function would be a list 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 list.
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 :
void neg(double *INOUT);
or you can use the %apply directive :
%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 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.
*/
/*----------------------------------------------------------------------
Front ends.
use the following macros to define your own IN/OUTPUT/INOUT typemaps
------------------------------------------------------------------------*/
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/primtypes.swg" %beginfile
/* ------------------------------------------------------------
* Primitive type fragments and macros
* ------------------------------------------------------------ */
/*
This file provide fragments and macros for the C/C++ primitive types.
The file defines default fragments for the following types:
bool
signed char
unsigned char
signed wchar_t // in C++
unsigned wchar_t // in C++
short
unsigned short
int
unsigned int
float
size_t
ptrdiff_t
which can always be redefined in the swig target language if needed.
The fragments for the following types, however, always need to be
defined in the target language:
long
unsigned long
long long
unsigned long long
double
If they are not provided, an #error directive will appear in the
wrapped code.
--------------------------------------------------------------------
This file provides the macro
%typemaps_primitive(CheckCode, Type)
which generates the typemaps for a primitive type with a given
checkcode. It is assumed that the primitive type is 'normalized' and
the corresponding SWIG_AsVal(Type) and SWIG_From(Type) methods are
provided via fragments.
The following auxiliary macros (explained with bash pseudo code) are
also defined:
%apply_ctypes(Macro)
for i in C Type
do
Macro($i)
done
%apply_cpptypes(Macro)
for i in C++ Type
do
Macro($i)
done
%apply_ctypes_2(Macro2)
for i in C Type
do
for j in C Type
do
Macro_2($i, $j)
done
done
%apply_cpptypes_2(Macro2)
for i in C++ Type
do
for j in C++ Type
do
Macro_2($i, $j)
done
done
%apply_checkctypes(Macro2)
for i in Check Type
do
Macro2(%checkcode($i), $i)
done
*/
/* ------------------------------------------------------------
* Primitive type fragments
* ------------------------------------------------------------ */
/* boolean */
%fragment("SWIG_" "From" "_" {bool},"header",fragment="SWIG_" "From" "_" {long}) {
SWIGINTERN PyObject *
SWIG_From_bool (bool value)
{
return SWIG_From_long (value ? 1 : 0);
}
}
%fragment("SWIG_" "AsVal" "_" {bool},"header",fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_bool (PyObject * obj, bool *val)
{
long v;
int res = SWIG_AsVal_long (obj, val ? &v : 0);
if (SWIG_IsOK(res)) {
if (val) *val = v ? true : false;
return res;
}
return SWIG_TypeError;
}
}
/* signed/unsigned char */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,192,%numeric_slong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {signed char},"header",
fragment="SWIG_" "From" "_" {long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_signed_SS_char (signed char value)
{
return SWIG_From_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {signed char},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_signed_SS_char (PyObject * obj, signed char *val)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v < SCHAR_MIN || v > SCHAR_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (signed char)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,199,%numeric_ulong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {unsigned char},"header",
fragment="SWIG_" "From" "_" {unsigned long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_unsigned_SS_char (unsigned char value)
{
return SWIG_From_unsigned_SS_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {unsigned char},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v > UCHAR_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (unsigned char)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/* short/unsigned short */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,192,%numeric_slong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {short},"header",
fragment="SWIG_" "From" "_" {long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_short (short value)
{
return SWIG_From_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {short},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_short (PyObject * obj, short *val)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v < SHRT_MIN || v > SHRT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (short)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,199,%numeric_ulong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {unsigned short},"header",
fragment="SWIG_" "From" "_" {unsigned long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_unsigned_SS_short (unsigned short value)
{
return SWIG_From_unsigned_SS_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {unsigned short},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v > USHRT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (unsigned short)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/* int/unsigned int */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,192,%numeric_slong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {int},"header",
fragment="SWIG_" "From" "_" {long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_int (int value)
{
return SWIG_From_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {int},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_int (PyObject * obj, int *val)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v < INT_MIN || v > INT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (int)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,199,%numeric_ulong@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {unsigned int},"header",
fragment="SWIG_" "From" "_" {unsigned long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_unsigned_SS_int (unsigned int value)
{
return SWIG_From_unsigned_SS_long (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {unsigned int},"header",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (SWIG_IsOK(res)) {
if ((v > UINT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = (unsigned int)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/* signed/unsigned wchar_t */
/* float */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,214,%numeric_float@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,151,%numeric_type_from@*/
%fragment("SWIG_" "From" "_" {float},"header",
fragment="SWIG_" "From" "_" {double}) {
SWIGINTERNINLINE PyObject *
SWIG_From_float (float value)
{
return SWIG_From_double (value);
}
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,162,%numeric_type_asval@*/
%fragment("SWIG_" "AsVal" "_" {float},"header",
fragment="SWIG_Float_Overflow_Check",
fragment="SWIG_" "AsVal" "_" {double}) {
SWIGINTERN int
SWIG_AsVal_float (PyObject * obj, float *val)
{
double v;
int res = SWIG_AsVal_double (obj, &v);
if (SWIG_IsOK(res)) {
if (SWIG_Float_Overflow_Check(v)) {
return SWIG_OverflowError;
} else {
if (val) *val = (float)(v);
}
}
return res;
}
}
/*@SWIG@*/
/*@SWIG@*/
/* long/unsigned long */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {long},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(long) fragment"
}
%fragment("SWIG_" "AsVal" "_" {long},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(long) fragment"
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {unsigned long},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(unsigned long) fragment"
}
%fragment("SWIG_" "AsVal" "_" {unsigned long},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(unsigned long) fragment"
}
/*@SWIG@*/
/* long long/unsigned long long */
%fragment("SWIG_LongLongAvailable","header", fragment="<limits.h>") %{
#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
# define SWIG_LONG_LONG_AVAILABLE
#endif
%}
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {long long},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(long long) fragment"
}
%fragment("SWIG_" "AsVal" "_" {long long},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(long long) fragment"
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {unsigned long long},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(unsigned long long) fragment"
}
%fragment("SWIG_" "AsVal" "_" {unsigned long long},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(unsigned long long) fragment"
}
/*@SWIG@*/
/* double */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,228,%ensure_type_fragments@*/
%fragment("SWIG_" "From" "_" {double},"header") {
#error "SWIG language implementation must provide a SWIG_From_frag(double) fragment"
}
%fragment("SWIG_" "AsVal" "_" {double},"header") {
#error "SWIG language implementation must provide a SWIG_AsVal_frag(double) fragment"
}
/*@SWIG@*/
/* size_t */
%fragment("SWIG_" "From" "_" {size_t},"header",fragment="SWIG_" "From" "_" {unsigned long},fragment="SWIG_" "From" "_" {unsigned long long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_size_t (size_t value)
{
#ifdef SWIG_LONG_LONG_AVAILABLE
if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
return SWIG_From_unsigned_SS_long ((unsigned long)(value));
#ifdef SWIG_LONG_LONG_AVAILABLE
} else {
/* assume sizeof(size_t) <= sizeof(unsigned long long) */
return SWIG_From_unsigned_SS_long_SS_long ((unsigned long long)(value));
}
#endif
}
}
%fragment("SWIG_" "AsVal" "_" {size_t},"header",fragment="SWIG_" "AsVal" "_" {unsigned long},fragment="SWIG_" "AsVal" "_" {unsigned long long}) {
SWIGINTERNINLINE int
SWIG_AsVal_size_t (PyObject * obj, size_t *val)
{
int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
unsigned long v;
res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = (size_t)(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
} else if (sizeof(size_t) <= sizeof(unsigned long long)) {
unsigned long long v;
res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = (size_t)(v);
}
#endif
return res;
}
}
/* ptrdiff_t */
%fragment("SWIG_" "From" "_" {ptrdiff_t},"header",fragment="SWIG_" "From" "_" {long},fragment="SWIG_" "From" "_" {long long}) {
SWIGINTERNINLINE PyObject *
SWIG_From_ptrdiff_t (ptrdiff_t value)
{
#ifdef SWIG_LONG_LONG_AVAILABLE
if (sizeof(ptrdiff_t) <= sizeof(long)) {
#endif
return SWIG_From_long ((long)(value));
#ifdef SWIG_LONG_LONG_AVAILABLE
} else {
/* assume sizeof(ptrdiff_t) <= sizeof(long long) */
return SWIG_From_long_SS_long ((long long)(value));
}
#endif
}
}
%fragment("SWIG_" "AsVal" "_" {ptrdiff_t},"header",fragment="SWIG_" "AsVal" "_" {long},fragment="SWIG_" "AsVal" "_" {long long}) {
SWIGINTERNINLINE int
SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
{
int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
if (sizeof(ptrdiff_t) <= sizeof(long)) {
#endif
long v;
res = SWIG_AsVal_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = (ptrdiff_t)(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
} else if (sizeof(ptrdiff_t) <= sizeof(long long)) {
long long v;
res = SWIG_AsVal_long_SS_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = (ptrdiff_t)(v);
}
#endif
return res;
}
}
%fragment("SWIG_CanCastAsInteger","header",
fragment="SWIG_" "AsVal" "_" {double},
fragment="<float.h>",
fragment="<math.h>") {
SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double *d, double min, double max) {
double x = *d;
if ((min <= x && x <= max)) {
double fx = floor(x);
double cx = ceil(x);
double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
if ((errno == EDOM) || (errno == ERANGE)) {
errno = 0;
} else {
double summ, reps, diff;
if (rd < x) {
diff = x - rd;
} else if (rd > x) {
diff = rd - x;
} else {
return 1;
}
summ = rd + x;
reps = diff/summ;
if (reps < 8*DBL_EPSILON) {
*d = rd;
return 1;
}
}
}
return 0;
}
}
/* ------------------------------------------------------------
* Generate the typemaps for primitive type
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* Primitive Type Macros
* ------------------------------------------------------------ */
/* useful macros to derive typemap declarations from primitive types */
/* Apply macro to the C-types */
/* apply the Macro2(Type1, Type2) to all C types */
/* apply the Macro(Type) to all C++ types */
/* apply the Macro2(Type1, Type2) to all C++ types */
/* apply the Macro2(CheckCode,Type) to all Checked Types */
/* ------------------------------------------------------------
* Generate the typemaps for all the primitive types with checkcode
* ------------------------------------------------------------ */
/*@SWIG:/usr/share/swig/4.0.0/typemaps/primtypes.swg,341,%apply_checkctypes@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool (bool val, int ecode = 0) {
ecode = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) bool "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) const bool & ($*ltype temp, bool val, int ecode = 0) {
ecode = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const bool& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {bool}) bool {
bool val;
int res = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool *DIRECTOROUT(bool swig_val, int swig_res) {
swig_res = SWIG_AsVal_bool($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool {
bool swig_val;
int swig_res = SWIG_AsVal_bool($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {bool},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const bool& {
bool swig_val;
int swig_res = SWIG_AsVal_bool($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const bool & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {bool}) bool &DIRECTOROUT = bool
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=15,fragment="SWIG_" "AsVal" "_" {bool}) bool, const bool& {
int res = SWIG_AsVal_bool($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
bool val;
int ecode = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {bool}) bool &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
bool val;
int ecode = SWIG_AsVal_bool($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") bool *INPUT, bool &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=15,fragment="SWIG_" "AsVal" "_" {bool}) bool *INPUT, bool &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_bool($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool, const bool {
$result = SWIG_From_bool((bool)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {bool}) const bool& {
$result = SWIG_From_bool((bool)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool, const bool& {
$result = SWIG_From_bool((bool)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_bool((bool)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool *DIRECTORIN {
$input = SWIG_From_bool((bool)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool, const bool& {
$input = SWIG_From_bool((bool)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool {
SWIG_Python_Raise(SWIG_From_bool((bool)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
bool *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
bool &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {bool}) bool *OUTPUT, bool &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_bool((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) bool *INOUT = bool *INPUT;
%typemap(in) bool &INOUT = bool &INPUT;
%typemap(typecheck) bool *INOUT = bool *INPUT;
%typemap(typecheck) bool &INOUT = bool &INPUT;
%typemap(argout) bool *INOUT = bool *OUTPUT;
%typemap(argout) bool &INOUT = bool &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char (signed char val, int ecode = 0) {
ecode = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) signed char "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) const signed char & ($*ltype temp, signed char val, int ecode = 0) {
ecode = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const signed char& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {signed char}) signed char {
signed char val;
int res = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char *DIRECTOROUT(signed char swig_val, int swig_res) {
swig_res = SWIG_AsVal_signed_SS_char($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char {
signed char swig_val;
int swig_res = SWIG_AsVal_signed_SS_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const signed char& {
signed char swig_val;
int swig_res = SWIG_AsVal_signed_SS_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const signed char & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {signed char}) signed char &DIRECTOROUT = signed char
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=25,fragment="SWIG_" "AsVal" "_" {signed char}) signed char, const signed char& {
int res = SWIG_AsVal_signed_SS_char($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
signed char val;
int ecode = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {signed char}) signed char &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
signed char val;
int ecode = SWIG_AsVal_signed_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") signed char *INPUT, signed char &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=25,fragment="SWIG_" "AsVal" "_" {signed char}) signed char *INPUT, signed char &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_signed_SS_char($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char, const signed char {
$result = SWIG_From_signed_SS_char((signed char)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {signed char}) const signed char& {
$result = SWIG_From_signed_SS_char((signed char)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char, const signed char& {
$result = SWIG_From_signed_SS_char((signed char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_signed_SS_char((signed char)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char *DIRECTORIN {
$input = SWIG_From_signed_SS_char((signed char)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char, const signed char& {
$input = SWIG_From_signed_SS_char((signed char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char {
SWIG_Python_Raise(SWIG_From_signed_SS_char((signed char)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
signed char *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
signed char &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {signed char}) signed char *OUTPUT, signed char &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_signed_SS_char((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) signed char *INOUT = signed char *INPUT;
%typemap(in) signed char &INOUT = signed char &INPUT;
%typemap(typecheck) signed char *INOUT = signed char *INPUT;
%typemap(typecheck) signed char &INOUT = signed char &INPUT;
%typemap(argout) signed char *INOUT = signed char *OUTPUT;
%typemap(argout) signed char &INOUT = signed char &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char (unsigned char val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned char "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) const unsigned char & ($*ltype temp, unsigned char val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned char& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char {
unsigned char val;
int res = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char *DIRECTOROUT(unsigned char swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_char($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char {
unsigned char swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned char& {
unsigned char swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned char & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char &DIRECTOROUT = unsigned char
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=20,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char, const unsigned char& {
int res = SWIG_AsVal_unsigned_SS_char($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned char val;
int ecode = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned char val;
int ecode = SWIG_AsVal_unsigned_SS_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned char *INPUT, unsigned char &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=20,fragment="SWIG_" "AsVal" "_" {unsigned char}) unsigned char *INPUT, unsigned char &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_char($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char, const unsigned char {
$result = SWIG_From_unsigned_SS_char((unsigned char)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) const unsigned char& {
$result = SWIG_From_unsigned_SS_char((unsigned char)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char, const unsigned char& {
$result = SWIG_From_unsigned_SS_char((unsigned char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_char((unsigned char)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char *DIRECTORIN {
$input = SWIG_From_unsigned_SS_char((unsigned char)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char, const unsigned char& {
$input = SWIG_From_unsigned_SS_char((unsigned char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char {
SWIG_Python_Raise(SWIG_From_unsigned_SS_char((unsigned char)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned char *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned char &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned char}) unsigned char *OUTPUT, unsigned char &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_char((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned char *INOUT = unsigned char *INPUT;
%typemap(in) unsigned char &INOUT = unsigned char &INPUT;
%typemap(typecheck) unsigned char *INOUT = unsigned char *INPUT;
%typemap(typecheck) unsigned char &INOUT = unsigned char &INPUT;
%typemap(argout) unsigned char *INOUT = unsigned char *OUTPUT;
%typemap(argout) unsigned char &INOUT = unsigned char &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short (short val, int ecode = 0) {
ecode = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) short "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) const short & ($*ltype temp, short val, int ecode = 0) {
ecode = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const short& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {short}) short {
short val;
int res = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short *DIRECTOROUT(short swig_val, int swig_res) {
swig_res = SWIG_AsVal_short($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short {
short swig_val;
int swig_res = SWIG_AsVal_short($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {short},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const short& {
short swig_val;
int swig_res = SWIG_AsVal_short($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const short & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {short}) short &DIRECTOROUT = short
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=35,fragment="SWIG_" "AsVal" "_" {short}) short, const short& {
int res = SWIG_AsVal_short($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
short val;
int ecode = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {short}) short &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
short val;
int ecode = SWIG_AsVal_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") short *INPUT, short &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=35,fragment="SWIG_" "AsVal" "_" {short}) short *INPUT, short &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_short($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {short}) short, const short {
$result = SWIG_From_short((short)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {short}) const short& {
$result = SWIG_From_short((short)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {short}) short, const short& {
$result = SWIG_From_short((short)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {short}) short {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_short((short)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {short}) short *DIRECTORIN {
$input = SWIG_From_short((short)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {short}) short, const short& {
$input = SWIG_From_short((short)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {short}) short {
SWIG_Python_Raise(SWIG_From_short((short)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
short *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
short &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {short}) short *OUTPUT, short &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_short((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) short *INOUT = short *INPUT;
%typemap(in) short &INOUT = short &INPUT;
%typemap(typecheck) short *INOUT = short *INPUT;
%typemap(typecheck) short &INOUT = short &INPUT;
%typemap(argout) short *INOUT = short *OUTPUT;
%typemap(argout) short &INOUT = short &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short (unsigned short val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned short "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) const unsigned short & ($*ltype temp, unsigned short val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned short& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short {
unsigned short val;
int res = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short *DIRECTOROUT(unsigned short swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_short($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short {
unsigned short swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_short($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned short& {
unsigned short swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_short($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned short & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short &DIRECTOROUT = unsigned short
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=30,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short, const unsigned short& {
int res = SWIG_AsVal_unsigned_SS_short($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned short val;
int ecode = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned short val;
int ecode = SWIG_AsVal_unsigned_SS_short($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned short *INPUT, unsigned short &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=30,fragment="SWIG_" "AsVal" "_" {unsigned short}) unsigned short *INPUT, unsigned short &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_short($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short, const unsigned short {
$result = SWIG_From_unsigned_SS_short((unsigned short)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) const unsigned short& {
$result = SWIG_From_unsigned_SS_short((unsigned short)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short, const unsigned short& {
$result = SWIG_From_unsigned_SS_short((unsigned short)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_short((unsigned short)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short *DIRECTORIN {
$input = SWIG_From_unsigned_SS_short((unsigned short)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short, const unsigned short& {
$input = SWIG_From_unsigned_SS_short((unsigned short)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short {
SWIG_Python_Raise(SWIG_From_unsigned_SS_short((unsigned short)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned short *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned short &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned short}) unsigned short *OUTPUT, unsigned short &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_short((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned short *INOUT = unsigned short *INPUT;
%typemap(in) unsigned short &INOUT = unsigned short &INPUT;
%typemap(typecheck) unsigned short *INOUT = unsigned short *INPUT;
%typemap(typecheck) unsigned short &INOUT = unsigned short &INPUT;
%typemap(argout) unsigned short *INOUT = unsigned short *OUTPUT;
%typemap(argout) unsigned short &INOUT = unsigned short &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int (int val, int ecode = 0) {
ecode = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) int "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) const int & ($*ltype temp, int val, int ecode = 0) {
ecode = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const int& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {int}) int {
int val;
int res = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int *DIRECTOROUT(int swig_val, int swig_res) {
swig_res = SWIG_AsVal_int($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int {
int swig_val;
int swig_res = SWIG_AsVal_int($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {int},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const int& {
int swig_val;
int swig_res = SWIG_AsVal_int($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const int & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {int}) int &DIRECTOROUT = int
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=45,fragment="SWIG_" "AsVal" "_" {int}) int, const int& {
int res = SWIG_AsVal_int($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
int val;
int ecode = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {int}) int &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
int val;
int ecode = SWIG_AsVal_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") int *INPUT, int &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=45,fragment="SWIG_" "AsVal" "_" {int}) int *INPUT, int &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_int($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {int}) int, const int {
$result = SWIG_From_int((int)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {int}) const int& {
$result = SWIG_From_int((int)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {int}) int, const int& {
$result = SWIG_From_int((int)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {int}) int {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_int((int)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {int}) int *DIRECTORIN {
$input = SWIG_From_int((int)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {int}) int, const int& {
$input = SWIG_From_int((int)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {int}) int {
SWIG_Python_Raise(SWIG_From_int((int)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
int *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
int &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {int}) int *OUTPUT, int &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_int((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) int *INOUT = int *INPUT;
%typemap(in) int &INOUT = int &INPUT;
%typemap(typecheck) int *INOUT = int *INPUT;
%typemap(typecheck) int &INOUT = int &INPUT;
%typemap(argout) int *INOUT = int *OUTPUT;
%typemap(argout) int &INOUT = int &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int (unsigned int val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned int "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) const unsigned int & ($*ltype temp, unsigned int val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned int& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int {
unsigned int val;
int res = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int *DIRECTOROUT(unsigned int swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_int($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int {
unsigned int swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_int($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned int& {
unsigned int swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_int($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned int & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int &DIRECTOROUT = unsigned int
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=40,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int, const unsigned int& {
int res = SWIG_AsVal_unsigned_SS_int($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned int val;
int ecode = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned int val;
int ecode = SWIG_AsVal_unsigned_SS_int($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned int *INPUT, unsigned int &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=40,fragment="SWIG_" "AsVal" "_" {unsigned int}) unsigned int *INPUT, unsigned int &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_int($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int, const unsigned int {
$result = SWIG_From_unsigned_SS_int((unsigned int)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) const unsigned int& {
$result = SWIG_From_unsigned_SS_int((unsigned int)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int, const unsigned int& {
$result = SWIG_From_unsigned_SS_int((unsigned int)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_int((unsigned int)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int *DIRECTORIN {
$input = SWIG_From_unsigned_SS_int((unsigned int)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int, const unsigned int& {
$input = SWIG_From_unsigned_SS_int((unsigned int)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int {
SWIG_Python_Raise(SWIG_From_unsigned_SS_int((unsigned int)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned int *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned int &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned int}) unsigned int *OUTPUT, unsigned int &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_int((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned int *INOUT = unsigned int *INPUT;
%typemap(in) unsigned int &INOUT = unsigned int &INPUT;
%typemap(typecheck) unsigned int *INOUT = unsigned int *INPUT;
%typemap(typecheck) unsigned int &INOUT = unsigned int &INPUT;
%typemap(argout) unsigned int *INOUT = unsigned int *OUTPUT;
%typemap(argout) unsigned int &INOUT = unsigned int &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long (long val, int ecode = 0) {
ecode = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) long "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) const long & ($*ltype temp, long val, int ecode = 0) {
ecode = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const long& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {long}) long {
long val;
int res = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long *DIRECTOROUT(long swig_val, int swig_res) {
swig_res = SWIG_AsVal_long($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long {
long swig_val;
int swig_res = SWIG_AsVal_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {long},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const long& {
long swig_val;
int swig_res = SWIG_AsVal_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const long & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {long}) long &DIRECTOROUT = long
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=55,fragment="SWIG_" "AsVal" "_" {long}) long, const long& {
int res = SWIG_AsVal_long($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
long val;
int ecode = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long}) long &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
long val;
int ecode = SWIG_AsVal_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") long *INPUT, long &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=55,fragment="SWIG_" "AsVal" "_" {long}) long *INPUT, long &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_long($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {long}) long, const long {
$result = SWIG_From_long((long)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {long}) const long& {
$result = SWIG_From_long((long)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {long}) long, const long& {
$result = SWIG_From_long((long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {long}) long {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_long((long)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {long}) long *DIRECTORIN {
$input = SWIG_From_long((long)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {long}) long, const long& {
$input = SWIG_From_long((long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {long}) long {
SWIG_Python_Raise(SWIG_From_long((long)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
long *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
long &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {long}) long *OUTPUT, long &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_long((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) long *INOUT = long *INPUT;
%typemap(in) long &INOUT = long &INPUT;
%typemap(typecheck) long *INOUT = long *INPUT;
%typemap(typecheck) long &INOUT = long &INPUT;
%typemap(argout) long *INOUT = long *OUTPUT;
%typemap(argout) long &INOUT = long &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long (unsigned long val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned long "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) const unsigned long & ($*ltype temp, unsigned long val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned long& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long {
unsigned long val;
int res = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long *DIRECTOROUT(unsigned long swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_long($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long {
unsigned long swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned long& {
unsigned long swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned long & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long &DIRECTOROUT = unsigned long
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=50,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long, const unsigned long& {
int res = SWIG_AsVal_unsigned_SS_long($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned long val;
int ecode = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned long val;
int ecode = SWIG_AsVal_unsigned_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned long *INPUT, unsigned long &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=50,fragment="SWIG_" "AsVal" "_" {unsigned long}) unsigned long *INPUT, unsigned long &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_long($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long, const unsigned long {
$result = SWIG_From_unsigned_SS_long((unsigned long)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) const unsigned long& {
$result = SWIG_From_unsigned_SS_long((unsigned long)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long, const unsigned long& {
$result = SWIG_From_unsigned_SS_long((unsigned long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_long((unsigned long)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long *DIRECTORIN {
$input = SWIG_From_unsigned_SS_long((unsigned long)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long, const unsigned long& {
$input = SWIG_From_unsigned_SS_long((unsigned long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long {
SWIG_Python_Raise(SWIG_From_unsigned_SS_long((unsigned long)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned long *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned long &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned long}) unsigned long *OUTPUT, unsigned long &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_long((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned long *INOUT = unsigned long *INPUT;
%typemap(in) unsigned long &INOUT = unsigned long &INPUT;
%typemap(typecheck) unsigned long *INOUT = unsigned long *INPUT;
%typemap(typecheck) unsigned long &INOUT = unsigned long &INPUT;
%typemap(argout) unsigned long *INOUT = unsigned long *OUTPUT;
%typemap(argout) unsigned long &INOUT = unsigned long &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long (long long val, int ecode = 0) {
ecode = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) long long "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) const long long & ($*ltype temp, long long val, int ecode = 0) {
ecode = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const long long& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {long long}) long long {
long long val;
int res = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long *DIRECTOROUT(long long swig_val, int swig_res) {
swig_res = SWIG_AsVal_long_SS_long($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long {
long long swig_val;
int swig_res = SWIG_AsVal_long_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {long long},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const long long& {
long long swig_val;
int swig_res = SWIG_AsVal_long_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const long long & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {long long}) long long &DIRECTOROUT = long long
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=65,fragment="SWIG_" "AsVal" "_" {long long}) long long, const long long& {
int res = SWIG_AsVal_long_SS_long($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
long long val;
int ecode = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {long long}) long long &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
long long val;
int ecode = SWIG_AsVal_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") long long *INPUT, long long &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=65,fragment="SWIG_" "AsVal" "_" {long long}) long long *INPUT, long long &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_long_SS_long($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long, const long long {
$result = SWIG_From_long_SS_long((long long)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {long long}) const long long& {
$result = SWIG_From_long_SS_long((long long)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long, const long long& {
$result = SWIG_From_long_SS_long((long long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_long_SS_long((long long)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long *DIRECTORIN {
$input = SWIG_From_long_SS_long((long long)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long, const long long& {
$input = SWIG_From_long_SS_long((long long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long {
SWIG_Python_Raise(SWIG_From_long_SS_long((long long)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
long long *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
long long &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {long long}) long long *OUTPUT, long long &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_long_SS_long((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) long long *INOUT = long long *INPUT;
%typemap(in) long long &INOUT = long long &INPUT;
%typemap(typecheck) long long *INOUT = long long *INPUT;
%typemap(typecheck) long long &INOUT = long long &INPUT;
%typemap(argout) long long *INOUT = long long *OUTPUT;
%typemap(argout) long long &INOUT = long long &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long (unsigned long long val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) unsigned long long "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) const unsigned long long & ($*ltype temp, unsigned long long val, int ecode = 0) {
ecode = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const unsigned long long& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long {
unsigned long long val;
int res = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long *DIRECTOROUT(unsigned long long swig_val, int swig_res) {
swig_res = SWIG_AsVal_unsigned_SS_long_SS_long($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long {
unsigned long long swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_long_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const unsigned long long& {
unsigned long long swig_val;
int swig_res = SWIG_AsVal_unsigned_SS_long_SS_long($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const unsigned long long & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long &DIRECTOROUT = unsigned long long
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=60,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long, const unsigned long long& {
int res = SWIG_AsVal_unsigned_SS_long_SS_long($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned long long val;
int ecode = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
unsigned long long val;
int ecode = SWIG_AsVal_unsigned_SS_long_SS_long($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") unsigned long long *INPUT, unsigned long long &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=60,fragment="SWIG_" "AsVal" "_" {unsigned long long}) unsigned long long *INPUT, unsigned long long &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_unsigned_SS_long_SS_long($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long, const unsigned long long {
$result = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) const unsigned long long& {
$result = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long, const unsigned long long& {
$result = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long *DIRECTORIN {
$input = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long, const unsigned long long& {
$input = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long {
SWIG_Python_Raise(SWIG_From_unsigned_SS_long_SS_long((unsigned long long)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
unsigned long long *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
unsigned long long &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {unsigned long long}) unsigned long long *OUTPUT, unsigned long long &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_unsigned_SS_long_SS_long((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) unsigned long long *INOUT = unsigned long long *INPUT;
%typemap(in) unsigned long long &INOUT = unsigned long long &INPUT;
%typemap(typecheck) unsigned long long *INOUT = unsigned long long *INPUT;
%typemap(typecheck) unsigned long long &INOUT = unsigned long long &INPUT;
%typemap(argout) unsigned long long *INOUT = unsigned long long *OUTPUT;
%typemap(argout) unsigned long long &INOUT = unsigned long long &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float (float val, int ecode = 0) {
ecode = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) float "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) const float & ($*ltype temp, float val, int ecode = 0) {
ecode = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const float& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {float}) float {
float val;
int res = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float *DIRECTOROUT(float swig_val, int swig_res) {
swig_res = SWIG_AsVal_float($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float {
float swig_val;
int swig_res = SWIG_AsVal_float($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {float},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const float& {
float swig_val;
int swig_res = SWIG_AsVal_float($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const float & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {float}) float &DIRECTOROUT = float
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=80,fragment="SWIG_" "AsVal" "_" {float}) float, const float& {
int res = SWIG_AsVal_float($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
float val;
int ecode = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {float}) float &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
float val;
int ecode = SWIG_AsVal_float($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") float *INPUT, float &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=80,fragment="SWIG_" "AsVal" "_" {float}) float *INPUT, float &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_float($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {float}) float, const float {
$result = SWIG_From_float((float)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {float}) const float& {
$result = SWIG_From_float((float)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {float}) float, const float& {
$result = SWIG_From_float((float)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {float}) float {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_float((float)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {float}) float *DIRECTORIN {
$input = SWIG_From_float((float)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {float}) float, const float& {
$input = SWIG_From_float((float)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {float}) float {
SWIG_Python_Raise(SWIG_From_float((float)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
float *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
float &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {float}) float *OUTPUT, float &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_float((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) float *INOUT = float *INPUT;
%typemap(in) float &INOUT = float &INPUT;
%typemap(typecheck) float *INOUT = float *INPUT;
%typemap(typecheck) float &INOUT = float &INPUT;
%typemap(argout) float *INOUT = float *OUTPUT;
%typemap(argout) float &INOUT = float &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double (double val, int ecode = 0) {
ecode = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) double "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) const double & ($*ltype temp, double val, int ecode = 0) {
ecode = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const double& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {double}) double {
double val;
int res = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double *DIRECTOROUT(double swig_val, int swig_res) {
swig_res = SWIG_AsVal_double($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double {
double swig_val;
int swig_res = SWIG_AsVal_double($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {double},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const double& {
double swig_val;
int swig_res = SWIG_AsVal_double($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const double & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {double}) double &DIRECTOROUT = double
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=90,fragment="SWIG_" "AsVal" "_" {double}) double, const double& {
int res = SWIG_AsVal_double($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
double val;
int ecode = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {double}) double &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
double val;
int ecode = SWIG_AsVal_double($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") double *INPUT, double &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=90,fragment="SWIG_" "AsVal" "_" {double}) double *INPUT, double &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_double($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {double}) double, const double {
$result = SWIG_From_double((double)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {double}) const double& {
$result = SWIG_From_double((double)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {double}) double, const double& {
$result = SWIG_From_double((double)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {double}) double {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_double((double)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {double}) double *DIRECTORIN {
$input = SWIG_From_double((double)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {double}) double, const double& {
$input = SWIG_From_double((double)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {double}) double {
SWIG_Python_Raise(SWIG_From_double((double)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
double *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
double &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {double}) double *OUTPUT, double &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_double((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) double *INOUT = double *INPUT;
%typemap(in) double &INOUT = double &INPUT;
%typemap(typecheck) double *INOUT = double *INPUT;
%typemap(typecheck) double &INOUT = double &INPUT;
%typemap(argout) double *INOUT = double *OUTPUT;
%typemap(argout) double &INOUT = double &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char (char val, int ecode = 0) {
ecode = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) char "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) const char & ($*ltype temp, char val, int ecode = 0) {
ecode = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const char& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {char}) char {
char val;
int res = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char *DIRECTOROUT(char swig_val, int swig_res) {
swig_res = SWIG_AsVal_char($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char {
char swig_val;
int swig_res = SWIG_AsVal_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {char},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const char& {
char swig_val;
int swig_res = SWIG_AsVal_char($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const char & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {char}) char &DIRECTOROUT = char
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=130,fragment="SWIG_" "AsVal" "_" {char}) char, const char& {
int res = SWIG_AsVal_char($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
char val;
int ecode = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {char}) char &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
char val;
int ecode = SWIG_AsVal_char($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") char *INPUT, char &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=130,fragment="SWIG_" "AsVal" "_" {char}) char *INPUT, char &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_char($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {char}) char, const char {
$result = SWIG_From_char((char)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {char}) const char& {
$result = SWIG_From_char((char)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {char}) char, const char& {
$result = SWIG_From_char((char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {char}) char {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_char((char)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {char}) char *DIRECTORIN {
$input = SWIG_From_char((char)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {char}) char, const char& {
$input = SWIG_From_char((char)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {char}) char {
SWIG_Python_Raise(SWIG_From_char((char)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
char *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
char &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {char}) char *OUTPUT, char &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_char((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) char *INOUT = char *INPUT;
%typemap(in) char &INOUT = char &INPUT;
%typemap(typecheck) char *INOUT = char *INPUT;
%typemap(typecheck) char &INOUT = char &INPUT;
%typemap(argout) char *INOUT = char *OUTPUT;
%typemap(argout) char &INOUT = char &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t (wchar_t val, int ecode = 0) {
ecode = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) wchar_t "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) const wchar_t & ($*ltype temp, wchar_t val, int ecode = 0) {
ecode = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const wchar_t& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t {
wchar_t val;
int res = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t *DIRECTOROUT(wchar_t swig_val, int swig_res) {
swig_res = SWIG_AsVal_wchar_t($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t {
wchar_t swig_val;
int swig_res = SWIG_AsVal_wchar_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const wchar_t& {
wchar_t swig_val;
int swig_res = SWIG_AsVal_wchar_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const wchar_t & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t &DIRECTOROUT = wchar_t
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=110,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t, const wchar_t& {
int res = SWIG_AsVal_wchar_t($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
wchar_t val;
int ecode = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
wchar_t val;
int ecode = SWIG_AsVal_wchar_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") wchar_t *INPUT, wchar_t &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=110,fragment="SWIG_" "AsVal" "_" {wchar_t}) wchar_t *INPUT, wchar_t &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_wchar_t($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t, const wchar_t {
$result = SWIG_From_wchar_t((wchar_t)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) const wchar_t& {
$result = SWIG_From_wchar_t((wchar_t)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t, const wchar_t& {
$result = SWIG_From_wchar_t((wchar_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_wchar_t((wchar_t)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t *DIRECTORIN {
$input = SWIG_From_wchar_t((wchar_t)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t, const wchar_t& {
$input = SWIG_From_wchar_t((wchar_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t {
SWIG_Python_Raise(SWIG_From_wchar_t((wchar_t)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
wchar_t *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
wchar_t &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {wchar_t}) wchar_t *OUTPUT, wchar_t &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_wchar_t((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) wchar_t *INOUT = wchar_t *INPUT;
%typemap(in) wchar_t &INOUT = wchar_t &INPUT;
%typemap(typecheck) wchar_t *INOUT = wchar_t *INPUT;
%typemap(typecheck) wchar_t &INOUT = wchar_t &INPUT;
%typemap(argout) wchar_t *INOUT = wchar_t *OUTPUT;
%typemap(argout) wchar_t &INOUT = wchar_t &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t (size_t val, int ecode = 0) {
ecode = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) size_t "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) const size_t & ($*ltype temp, size_t val, int ecode = 0) {
ecode = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const size_t& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {size_t}) size_t {
size_t val;
int res = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t *DIRECTOROUT(size_t swig_val, int swig_res) {
swig_res = SWIG_AsVal_size_t($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t {
size_t swig_val;
int swig_res = SWIG_AsVal_size_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const size_t& {
size_t swig_val;
int swig_res = SWIG_AsVal_size_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const size_t & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {size_t}) size_t &DIRECTOROUT = size_t
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=47,fragment="SWIG_" "AsVal" "_" {size_t}) size_t, const size_t& {
int res = SWIG_AsVal_size_t($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
size_t val;
int ecode = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {size_t}) size_t &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
size_t val;
int ecode = SWIG_AsVal_size_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") size_t *INPUT, size_t &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=47,fragment="SWIG_" "AsVal" "_" {size_t}) size_t *INPUT, size_t &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_size_t($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t, const size_t {
$result = SWIG_From_size_t((size_t)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {size_t}) const size_t& {
$result = SWIG_From_size_t((size_t)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t, const size_t& {
$result = SWIG_From_size_t((size_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_size_t((size_t)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t *DIRECTORIN {
$input = SWIG_From_size_t((size_t)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t, const size_t& {
$input = SWIG_From_size_t((size_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t {
SWIG_Python_Raise(SWIG_From_size_t((size_t)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
size_t *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
size_t &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {size_t}) size_t *OUTPUT, size_t &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_size_t((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) size_t *INOUT = size_t *INPUT;
%typemap(in) size_t &INOUT = size_t &INPUT;
%typemap(typecheck) size_t *INOUT = size_t *INPUT;
%typemap(typecheck) size_t &INOUT = size_t &INPUT;
%typemap(argout) size_t *INOUT = size_t *OUTPUT;
%typemap(argout) size_t &INOUT = size_t &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,208,%typemaps_asvalfromn@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,197,%typemaps_asvalfrom@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,171,%typemaps_asval@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,33,%value_in_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t (ptrdiff_t val, int ecode = 0) {
ecode = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$ltype""'");
}
$1 = ($ltype)(val);
}
%typemap(freearg) ptrdiff_t "";
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) const ptrdiff_t & ($*ltype temp, ptrdiff_t val, int ecode = 0) {
ecode = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
}
%typemap(freearg) const ptrdiff_t& "";
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,66,%value_varin_typemap@*/
%typemap(varin,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t {
ptrdiff_t val;
int res = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
$1 = ($ltype)(val);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,109,%value_directorout_typemap@*/
%typemap(directorargout,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t *DIRECTOROUT(ptrdiff_t swig_val, int swig_res) {
swig_res = SWIG_AsVal_ptrdiff_t($result, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
*$1 = swig_val;
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t {
ptrdiff_t swig_val;
int swig_res = SWIG_AsVal_ptrdiff_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$result = ($type)(swig_val);
}
%typemap(directorout,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t},warning= "473:Returning a pointer or reference in a director method is not recommended." ) const ptrdiff_t& {
ptrdiff_t swig_val;
int swig_res = SWIG_AsVal_ptrdiff_t($input, &swig_val);
if (!SWIG_IsOK(swig_res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""$type""'");
}
$basetype *temp = new $basetype(($basetype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
%typemap(directorfree,noblock=1) const ptrdiff_t & {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t &DIRECTOROUT = ptrdiff_t
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,161,%value_typecheck_typemap@*/
%typemap(typecheck,precedence=48,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t, const ptrdiff_t& {
int res = SWIG_AsVal_ptrdiff_t($input, NULL);
$1 = SWIG_CheckState(res);
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,250,%value_input_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,79,%_value_input_typemap@*/
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t *INPUT ($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
ptrdiff_t val;
int ecode = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(in,noblock=1,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t &INPUT($*ltype temp, int res = 0) {
if (!(SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&$1),$descriptor,$disown))))) {
ptrdiff_t val;
int ecode = SWIG_AsVal_ptrdiff_t($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$*ltype""'");
}
temp = ($*ltype)(val);
$1 = &temp;
res = SWIG_AddTmpMask(ecode);
}
}
%typemap(freearg,noblock=1,match="in") ptrdiff_t *INPUT, ptrdiff_t &INPUT {
if (SWIG_IsNewObj(res$argnum)) free((char*)$1);
}
%typemap(typecheck,noblock=1,precedence=48,fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) ptrdiff_t *INPUT, ptrdiff_t &INPUT {
void *ptr = 0;
int res = SWIG_AsVal_ptrdiff_t($input, 0);
$1 = SWIG_CheckState(res);
if (!$1) {
$1 = (SWIG_IsOK((res = SWIG_ConvertPtr($input,SWIG_as_voidptrptr(&ptr),$1_descriptor,0))));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,183,%typemaps_from@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,55,%value_out_typemap@*/
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t, const ptrdiff_t {
$result = SWIG_From_ptrdiff_t((ptrdiff_t)($1));
}
%typemap(out,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) const ptrdiff_t& {
$result = SWIG_From_ptrdiff_t((ptrdiff_t)(*$1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,79,%value_varout_typemap@*/
%typemap(varout,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t, const ptrdiff_t& {
$result = SWIG_From_ptrdiff_t((ptrdiff_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,87,%value_constcode_typemap@*/
%typemap(constcode,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t {
SWIG_Python_SetConstant(d, "$symname",SWIG_From_ptrdiff_t((ptrdiff_t)($value)));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,98,%value_directorin_typemap@*/
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t *DIRECTORIN {
$input = SWIG_From_ptrdiff_t((ptrdiff_t)(*$1));
}
%typemap(directorin,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t, const ptrdiff_t& {
$input = SWIG_From_ptrdiff_t((ptrdiff_t)($1));
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/valtypes.swg,153,%value_throws_typemap@*/
%typemap(throws,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t {
SWIG_Python_Raise(SWIG_From_ptrdiff_t((ptrdiff_t)($1)), "$type", 0); SWIG_fail;
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,258,%value_output_typemap@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,175,%_value_output_typemap@*/
%typemap(in,numinputs=0,noblock=1)
ptrdiff_t *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ),
ptrdiff_t &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) {
$1 = &temp;
}
%typemap(argout,noblock=1,fragment="SWIG_" "From" "_" {ptrdiff_t}) ptrdiff_t *OUTPUT, ptrdiff_t &OUTPUT {
if (SWIG_IsTmpObj(res$argnum)) {
$result = SWIG_Python_AppendOutput($result, SWIG_From_ptrdiff_t((*$1)));
} else {
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
$result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
}
}
/*@SWIG@*/
/*@SWIG@*/;
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/typemaps/inoutlist.swg,230,%_value_inout_typemap@*/
%typemap(in) ptrdiff_t *INOUT = ptrdiff_t *INPUT;
%typemap(in) ptrdiff_t &INOUT = ptrdiff_t &INPUT;
%typemap(typecheck) ptrdiff_t *INOUT = ptrdiff_t *INPUT;
%typemap(typecheck) ptrdiff_t &INOUT = ptrdiff_t &INPUT;
%typemap(argout) ptrdiff_t *INOUT = ptrdiff_t *OUTPUT;
%typemap(argout) ptrdiff_t &INOUT = ptrdiff_t &OUTPUT;
/*@SWIG@*/;
/*@SWIG@*/
;
/*@SWIG@*/;
/*@SWIG@*/;
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/string.swg" %beginfile
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,222,%ensure_fragment@*/
%fragment("SWIG_AsCharPtrAndSize","header") {
#error "SWIG language implementation must provide the SWIG_AsCharPtrAndSize fragment"
}
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/fragments.swg,222,%ensure_fragment@*/
%fragment("SWIG_FromCharPtrAndSize","header") {
#error "SWIG language implementation must provide the SWIG_FromCharPtrAndSize fragment"
}
/*@SWIG@*/
%types(char *);
%fragment("SWIG_pchar_descriptor","header") {
SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
static int init = 0;
static swig_type_info* info = 0;
if (!init) {
info = SWIG_TypeQuery("_p_char");
init = 1;
}
return info;
}
}
%fragment("SWIG_strnlen","header",fragment="SWIG_FromCharPtrAndSize") {
SWIGINTERN size_t
SWIG_strnlen(const char* s, size_t maxlen)
{
const char *p;
for (p = s; maxlen-- && *p; p++)
;
return p - s;
}
}
%includefile "/usr/share/swig/4.0.0/typemaps/strings.swg" %beginfile
//
// Use the macro SWIG_PRESERVE_CARRAY_SIZE if you prefer to preserve
// the size of char arrays, ie
// ------------------------------------------
// C Side => Language Side
// ------------------------------------------
// char name[5] = "hola" => 'hola\0'
//
// the default behaviour is
//
// char name[5] = "hola" => 'hola'
//
//
//#define SWIG_PRESERVE_CARRAY_SIZE
/* ------------------------------------------------------------
* String typemaps for type Char (char or wchar_t)
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* --- String fragment methods ---
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* String typemaps and fragments, with default allocators
* ------------------------------------------------------------ */
/* ------------------------------------------------------------
* String typemaps and fragments, with custom allocators
* ------------------------------------------------------------ */
%endoffile
/*@SWIG:/usr/share/swig/4.0.0/typemaps/strings.swg,611,%typemaps_string@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/strings.swg,503,%_typemap2_string@*/
%fragment("SWIG_From""Char""Ptr","header",fragment="SWIG_FromCharPtrAndSize") {
SWIGINTERNINLINE PyObject *
SWIG_FromCharPtr(const char *cptr)
{
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
}
%fragment("SWIG_From""Char""Array","header",fragment="SWIG_FromCharPtrAndSize") {
SWIGINTERNINLINE PyObject *
SWIG_FromCharArray(const char *cptr, size_t size)
{
return SWIG_FromCharPtrAndSize(cptr, size);
}
}
%fragment("SWIG_As""Char" "Ptr","header",fragment="SWIG_AsCharPtrAndSize") {
}
%fragment("SWIG_As""Char" "Array","header",fragment="SWIG_AsCharPtrAndSize") {
SWIGINTERN int
SWIG_AsCharArray(PyObject * obj, char *val, size_t size)
{
char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
if (SWIG_IsOK(res)) {
/* special case of single char conversion when we don't need space for NUL */
if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize;
if (csize <= size) {
if (val) {
if (csize) memcpy(val, cptr, csize*sizeof(char));
if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
}
if (alloc == SWIG_NEWOBJ) {
free((char*)cptr);
res = SWIG_DelNewMask(res);
}
return res;
}
if (alloc == SWIG_NEWOBJ) free((char*)cptr);
}
return SWIG_TypeError;
}
}
/* char */
%fragment("SWIG_" "From" "_" {char},"header",fragment="SWIG_FromCharPtrAndSize") {
SWIGINTERNINLINE PyObject *
SWIG_From_char (char c)
{
return SWIG_FromCharPtrAndSize(&c,1);
}
}
%fragment("SWIG_" "AsVal" "_" {char},"header",
fragment="SWIG_As""Char""Array",
fragment="<limits.h>",
fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERN int
SWIG_AsVal_char (PyObject * obj, char *val)
{
int res = SWIG_AsCharArray(obj, val, 1);
if (!SWIG_IsOK(res)) {
long v;
res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
if (SWIG_IsOK(res)) {
if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
if (val) *val = (char)(v);
} else {
res = SWIG_OverflowError;
}
}
}
return res;
}
}
/*@SWIG:/usr/share/swig/4.0.0/typemaps/strings.swg,20,%_typemap_string@*/
/* in */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtr")
char * (int res, char *buf = 0, int alloc = 0),
const char * (int res, char *buf = 0, int alloc = 0) {
res = SWIG_AsCharPtrAndSize($input, &buf, NULL, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($1_ltype)(buf);
}
%typemap(freearg,noblock=1,match="in") char *, const char * {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
%typemap(in,noblock=1,fragment="SWIG_AsCharPtr") char const*& (int res, char *buf = 0, int alloc = 0) {
res = SWIG_AsCharPtrAndSize($input, &buf, NULL, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = &buf;
}
%typemap(freearg, noblock=1,match="in") char const*& {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* out */
%typemap(out,noblock=1,fragment="SWIG_FromCharPtr") char *, const char * {
$result = SWIG_FromCharPtr((const char *)$1);
}
%typemap(out,noblock=1,fragment="SWIG_FromCharPtr") char const*& {
$result = SWIG_FromCharPtr(*$1);
}
%typemap(newfree,noblock=1) char * {
free((char*)$1);
}
/* varin */
%typemap(varin,fragment="SWIG_AsCharPtrAndSize") char * {
char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ;
int res = SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if ($1) free((char*)$1);
if (alloc == SWIG_NEWOBJ) {
$1 = cptr;
} else {
$1 = csize ? ($1_type)(char *)memcpy(malloc((csize)*sizeof(char)), cptr, sizeof(char)*(csize)) : 0;
}
}
%typemap(varin,fragment="SWIG_AsCharPtrAndSize",warning= "451:Setting a const char * variable may leak memory." ) const char * {
char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ;
int res = SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
if (alloc == SWIG_NEWOBJ) {
$1 = cptr;
} else {
$1 = csize ? ($1_type)(char *)memcpy(malloc((csize)*sizeof(char)), cptr, sizeof(char)*(csize)) : 0;
}
}
/* varout */
%typemap(varout,noblock=1,fragment="SWIG_FromCharPtr") char *, const char * {
$result = SWIG_FromCharPtr($1);
}
/* memberin */
%typemap(memberin,noblock=1) char * {
if ($1) free((char*)$1);
if ($input) {
size_t size = strlen((const char *)($input)) + 1;
$1 = ($1_type)(char *)memcpy(malloc((size)*sizeof(char)), (const char *)($input), sizeof(char)*(size));
} else {
$1 = 0;
}
}
%typemap(memberin,noblock=1,warning= "451:Setting a const char * variable may leak memory." ) const char * {
if ($input) {
size_t size = strlen((const char *)((const char *)($input))) + 1;
$1 = ($1_type)(char *)memcpy(malloc((size)*sizeof(char)), $input, sizeof(char)*(size));
} else {
$1 = 0;
}
}
/* globalin */
%typemap(globalin,noblock=1) char * {
if ($1) free((char*)$1);
if ($input) {
size_t size = strlen((const char *)((const char *)($input))) + 1;
$1 = ($1_type)(char *)memcpy(malloc((size)*sizeof(char)), $input, sizeof(char)*(size));
} else {
$1 = 0;
}
}
%typemap(globalin,noblock=1,warning= "451:Setting a const char * variable may leak memory." ) const char * {
if ($input) {
size_t size = strlen($input) + 1;
$1 = ($1_type)(char *)memcpy(malloc((size)*sizeof(char)), $input, sizeof(char)*(size));
} else {
$1 = 0;
}
}
/* constant */
%typemap(constcode,noblock=1,fragment="SWIG_FromCharPtr")
char *, char const*, char * const, char const* const {
SWIG_Python_SetConstant(d, "$symname",SWIG_FromCharPtr($value));
}
/* directorin */
%typemap(directorin,noblock=1,fragment="SWIG_FromCharPtr")
char *, char const*, char *const, char const *const,
char const *&, char *const &, char const *const & {
$input = SWIG_FromCharPtr((const char *)$1);
}
/* directorout */
%typemap(directorout,noblock=1,fragment="SWIG_AsCharPtr",warning= "473:Returning a pointer or reference in a director method is not recommended." ) char * (int res, char *buf = 0, int alloc = SWIG_NEWOBJ) {
res = SWIG_AsCharPtrAndSize($input, &buf, NULL, &alloc);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
if (alloc == SWIG_NEWOBJ) {
swig_acquire_ownership_array(buf);
}
$result = ($1_ltype)(buf);
}
%typemap(directorfree,noblock=1) char *
{
if (director) {
director->swig_release_ownership(SWIG_as_voidptr($input));
}
}
%typemap(directorout,noblock=1,fragment="SWIG_AsCharPtr",warning= "473:Returning a pointer or reference in a director method is not recommended." ) char *const& (int res, char *buf = 0, int alloc = SWIG_NEWOBJ), char const*const& (int res, char *buf = 0, int alloc = SWIG_NEWOBJ) {
res = SWIG_AsCharPtrAndSize($input, &buf, NULL, &alloc);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
static $*1_ltype tmp = buf;
$result = &tmp;
if (alloc == SWIG_NEWOBJ) {
swig_acquire_ownership_array(buf);
}
}
%typemap(directorfree,noblock=1)
char * const&, char const* const& {
if (director) {
director->swig_release_ownership(SWIG_as_voidptr(*$input));
}
}
/* typecheck */
%typemap(typecheck,noblock=1,precedence=140,
fragment="SWIG_AsCharPtr") char *, const char *, char const*& {
int res = SWIG_AsCharPtrAndSize($input, 0, NULL, 0);
$1 = SWIG_CheckState(res);
}
/* throws */
%typemap(throws,noblock=1,fragment="SWIG_FromCharPtr") char * {
SWIG_Python_Raise(SWIG_FromCharPtr($1), "$type", 0); SWIG_fail;
}
/* ------------------------------------------------------------
* Unknown size const Character array char[ANY] handling
* ------------------------------------------------------------ */
%apply char * { char [] };
%apply const char * { const char [] };
%typemap(varin,noblock=1,warning="462:Unable to set variable of type char []") char []
{
SWIG_exception_fail(SWIG_ArgError(SWIG_AttributeError), "in variable '""read-only $name""' of type '""$type""'");
}
/* ------------------------------------------------------------
* Fixed size Character array char[ANY] handling
* ------------------------------------------------------------ */
/* memberin and globalin typemaps */
%typemap(memberin,noblock=1) char [ANY]
{
if ($input) memcpy($1,$input,$1_dim0*sizeof(char));
else memset($1,0,$1_dim0*sizeof(char));
}
%typemap(globalin,noblock=1) char [ANY]
{
if ($input) memcpy($1,$input,$1_dim0*sizeof(char));
else memset($1,0,$1_dim0*sizeof(char));
}
/* in */
%typemap(in,noblock=1,fragment="SWIG_AsCharArray")
char [ANY] (char temp[$1_dim0], int res),
const char [ANY](char temp[$1_dim0], int res)
{
res = SWIG_AsCharArray($input, temp, $1_dim0);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($1_ltype)(temp);
}
%typemap(freearg) char [ANY], const char [ANY] "";
%typemap(in,noblock=1,fragment="SWIG_AsCharArray") const char (&)[ANY] (char temp[$1_dim0], int res)
{
res = SWIG_AsCharArray($input, temp, $1_dim0);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = &temp;
}
%typemap(freearg) const char (&)[ANY] "";
%typemap(out,fragment="SWIG_FromCharPtrAndSize",fragment="SWIG_strnlen")
char [ANY], const char[ANY]
{
size_t size = SWIG_strnlen($1, $1_dim0);
$result = SWIG_FromCharPtrAndSize($1, size);
}
/* varin */
%typemap(varin,fragment="SWIG_AsCharArray") char [ANY]
{
int res = SWIG_AsCharArray($input, $1, $1_dim0);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in variable '""$name""' of type '""$type""'");
}
}
/* varout */
%typemap(varout,fragment="SWIG_strnlen")
char [ANY], const char [ANY] {
size_t size = SWIG_strnlen($1, $1_dim0);
$result = SWIG_FromCharPtrAndSize($1, size);
}
/* constant */
%typemap(constcode,fragment="SWIG_strnlen")
char [ANY], const char [ANY]
{
size_t size = SWIG_strnlen($1, $1_dim0);
SWIG_Python_SetConstant(d, "$symname",SWIG_FromCharPtrAndSize($value,size));
}
/* directorin */
%typemap(directorin,fragment="SWIG_strnlen")
char [ANY], const char [ANY]
{
size_t size = SWIG_strnlen($1, $1_dim0);
$input = SWIG_FromCharPtrAndSize($1, size);
}
/* directorout */
%typemap(directorout,noblock=1,fragment="SWIG_AsCharArray")
char [ANY] (char temp[$result_dim0]),
const char [ANY] (char temp[$result_dim0], int res)
{
res = SWIG_AsCharArray($input, temp, $result_dim0);
if (!SWIG_IsOK(res)) {
Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(res)), "in output value of type '""$type""'");
}
$result = temp;
}
/* typecheck */
%typemap(typecheck,noblock=1,precedence=140,
fragment="SWIG_AsCharArray")
char [ANY], const char[ANY] {
int res = SWIG_AsCharArray($input, (char *)0, $1_dim0);
$1 = SWIG_CheckState(res);
}
/* throws */
%typemap(throws,fragment="SWIG_strnlen")
char [ANY], const char[ANY]
{
size_t size = SWIG_strnlen($1, $1_dim0);
SWIG_Python_Raise(SWIG_FromCharPtrAndSize($1, size), "$type", 0); SWIG_fail;
}
/* -------------------------------------------------------------------
* --- Really fix size char arrays, including '\0'chars at the end ---
* ------------------------------------------------------------------- */
%typemap(varout,noblock=1,fragment="SWIG_FromCharPtrAndSize")
char FIXSIZE[ANY], const char FIXSIZE[ANY]
{
$result = SWIG_FromCharPtrAndSize($1, $1_dim0);
}
%typemap(out,noblock=1,fragment="SWIG_FromCharPtrAndSize")
char FIXSIZE[ANY], const char FIXSIZE[ANY]
{
$result = SWIG_FromCharPtrAndSize($1, $1_dim0);
}
%typemap(directorin,noblock=1,fragment="SWIG_FromCharPtrAndSize")
char FIXSIZE[ANY], const char FIXSIZE[ANY]
{
$input = SWIG_FromCharPtrAndSize($1, $1_dim0);
}
%typemap(throws,noblock=1,fragment="SWIG_FromCharPtrAndSize")
char FIXSIZE[ANY], const char FIXSIZE[ANY] {
SWIG_Python_Raise(SWIG_FromCharPtrAndSize($1, $1_dim0), "$type", 0); SWIG_fail;
}
/* ------------------------------------------------------------
* --- String & length ---
* ------------------------------------------------------------ */
/* Here len doesn't include the '0' terminator */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtrAndSize")
(char *STRING, size_t LENGTH) (int res, char *buf = 0, size_t size = 0, int alloc = 0),
(const char *STRING, size_t LENGTH) (int res, char *buf = 0, size_t size = 0, int alloc = 0)
{
res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($1_ltype)(buf);
$2 = ($2_ltype)(size - 1);
}
%typemap(freearg,noblock=1,match="in") (char *STRING, size_t LENGTH) {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* old 'int' form */
%typemap(in) (char *STRING, int LENGTH) = (char *STRING, size_t LENGTH);
%typemap(freearg) (char *STRING, int LENGTH) = (char *STRING, size_t LENGTH);
/* Here size includes the '0' terminator */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtrAndSize")
(char *STRING, size_t SIZE) (int res, char *buf = 0, size_t size = 0, int alloc = 0),
(const char *STRING, size_t SIZE) (int res, char *buf = 0, size_t size = 0, int alloc = 0)
{
res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$1 = ($1_ltype)(buf);
$2 = ($2_ltype)(size);
}
%typemap(freearg,noblock=1,match="in") (char *STRING, size_t SIZE) {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* old 'int' form */
%typemap(in) (char *STRING, int SIZE) = (char *STRING, size_t SIZE);
%typemap(freearg) (char *STRING, int SIZE) = (char *STRING, size_t SIZE);
/* reverse order versions */
/* Here len doesn't include the '0' terminator */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtrAndSize")
(size_t LENGTH, char *STRING) (int res, char *buf = 0, size_t size = 0, int alloc = 0),
(size_t LENGTH, const char *STRING) (int res, char *buf = 0, size_t size = 0, int alloc = 0)
{
res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$2 = ($2_ltype)(buf) ;
$1 = ($1_ltype)(size - 1) ;
}
%typemap(freearg, noblock=1, match="in") (size_t LENGTH, char *STRING) {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* old 'int' form */
%typemap(in) (int LENGTH, char *STRING) = (size_t LENGTH, char *STRING);
%typemap(freearg) (int LENGTH, char *STRING) = (size_t LENGTH, char *STRING);
/* Here size includes the '0' terminator */
%typemap(in,noblock=1,fragment="SWIG_AsCharPtrAndSize")
(size_t SIZE, char *STRING) (int res, char *buf = 0, size_t size = 0, int alloc = 0),
(size_t SIZE, const char *STRING) (int res, char *buf = 0, size_t size = 0, int alloc = 0)
{
res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
if (!SWIG_IsOK(res)) {
SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
}
$2 = ($2_ltype)(buf) ;
$1 = ($1_ltype)(size) ;
}
%typemap(freearg, noblock=1, match="in") (size_t SIZE, char *STRING) {
if (alloc$argnum == SWIG_NEWOBJ) free((char*)buf$argnum);
}
/* old 'int' form */
%typemap(in) (int SIZE, char *STRING) = (size_t SIZE, char *STRING);
%typemap(freearg) (int SIZE, char *STRING) = (size_t SIZE, char *STRING);
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG@*/
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/misctypes.swg" %beginfile
/* ------------------------------------------------------------
* --- ANSI/Posix C/C++ types ---
* ------------------------------------------------------------ */
%endoffile
%includefile "/usr/share/swig/4.0.0/typemaps/enumint.swg" %beginfile
/* ------------------------------------------------------------
* Enums mapped as integer values
* ------------------------------------------------------------ */
%apply int { enum SWIGTYPE };
%apply const int& { const enum SWIGTYPE & };
%apply const int& { const enum SWIGTYPE && };
%typemap(in,fragment="SWIG_" "AsVal" "_" {int},noblock=1) const enum SWIGTYPE & (int val, int ecode, $basetype temp) {
ecode = SWIG_AsVal_int ($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
} else {
temp = ($basetype)(val);
$1 = &temp;
}
}
%typemap(in,fragment="SWIG_" "AsVal" "_" {int},noblock=1) const enum SWIGTYPE && (int val, int ecode, $basetype temp) {
ecode = SWIG_AsVal_int ($input, &val);
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "$symname" "', argument " "$argnum"" of type '" "$type""'");
} else {
temp = ($basetype)(val);
$1 = &temp;
}
}
%typemap(varin,fragment="SWIG_" "AsVal" "_" {int},noblock=1) enum SWIGTYPE {
if (sizeof(int) != sizeof($1)) {
SWIG_exception_fail(SWIG_ArgError(SWIG_AttributeError), "in variable '""arch, read-only $name""' of type '""$type""'");
} else {
int ecode = SWIG_AsVal_int ($input, (int*)(&$1));
if (!SWIG_IsOK(ecode)) {
SWIG_exception_fail(SWIG_ArgError(ecode), "in variable '""$name""' of type '""$type""'");
}
}
}
%endoffile
%endoffile
/* ------------------------------------------------------------
* 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(($*ltype *)memcpy(($*ltype *)calloc(1,sizeof($*ltype)),&*$1,sizeof($*ltype)), $descriptor, SWIG_POINTER_OWN | 0 );
}
%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);
}
}
}
%endoffile
/* ------------------------------------------------------------
* Overloaded operator support
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyopers.swg" %beginfile
/* ------------------------------------------------------------
* 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:<slot>"),
where <slot> 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
* ------------------------------------------------------------ */
%endoffile
/* ------------------------------------------------------------
* Warnings for Python keywords
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pythonkw.swg" %beginfile
/*
Warnings for Python keywords, built-in names and bad names.
*/
/*
Warnings for Python keywords
https://docs.python.org/2/reference/lexical_analysis.html#keywords
*/
%namewarn("314"":""'" "and" "' is a python keyword, renaming to '_" "and" "'",rename="_%s") "and";
%namewarn("314"":""'" "as" "' is a python keyword, renaming to '_" "as" "'",rename="_%s") "as";
%namewarn("314"":""'" "assert" "' is a python keyword, renaming to '_" "assert" "'",rename="_%s") "assert";
%namewarn("314"":""'" "async" "' is a python keyword, renaming to '_" "async" "'",rename="_%s") "async";
%namewarn("314"":""'" "await" "' is a python keyword, renaming to '_" "await" "'",rename="_%s") "await";
%namewarn("314"":""'" "break" "' is a python keyword, renaming to '_" "break" "'",rename="_%s") "break";
%namewarn("314"":""'" "class" "' is a python keyword, renaming to '_" "class" "'",rename="_%s") "class";
%namewarn("314"":""'" "continue" "' is a python keyword, renaming to '_" "continue" "'",rename="_%s") "continue";
%namewarn("314"":""'" "def" "' is a python keyword, renaming to '_" "def" "'",rename="_%s") "def";
%namewarn("314"":""'" "del" "' is a python keyword, renaming to '_" "del" "'",rename="_%s") "del";
%namewarn("314"":""'" "elif" "' is a python keyword, renaming to '_" "elif" "'",rename="_%s") "elif";
%namewarn("314"":""'" "else" "' is a python keyword, renaming to '_" "else" "'",rename="_%s") "else";
%namewarn("314"":""'" "except" "' is a python keyword, renaming to '_" "except" "'",rename="_%s") "except";
%namewarn("314"":""'" "exec" "' is a python keyword, renaming to '_" "exec" "'",rename="_%s") "exec";
%namewarn("314"":""'" "finally" "' is a python keyword, renaming to '_" "finally" "'",rename="_%s") "finally";
%namewarn("314"":""'" "for" "' is a python keyword, renaming to '_" "for" "'",rename="_%s") "for";
%namewarn("314"":""'" "from" "' is a python keyword, renaming to '_" "from" "'",rename="_%s") "from";
%namewarn("314"":""'" "global" "' is a python keyword, renaming to '_" "global" "'",rename="_%s") "global";
%namewarn("314"":""'" "if" "' is a python keyword, renaming to '_" "if" "'",rename="_%s") "if";
%namewarn("314"":""'" "import" "' is a python keyword, renaming to '_" "import" "'",rename="_%s") "import";
%namewarn("314"":""'" "in" "' is a python keyword, renaming to '_" "in" "'",rename="_%s") "in";
%namewarn("314"":""'" "is" "' is a python keyword, renaming to '_" "is" "'",rename="_%s") "is";
%namewarn("314"":""'" "lambda" "' is a python keyword, renaming to '_" "lambda" "'",rename="_%s") "lambda";
%namewarn("314"":""'" "not" "' is a python keyword, renaming to '_" "not" "'",rename="_%s") "not";
%namewarn("314"":""'" "or" "' is a python keyword, renaming to '_" "or" "'",rename="_%s") "or";
%namewarn("314"":""'" "pass" "' is a python keyword, renaming to '_" "pass" "'",rename="_%s") "pass";
%namewarn("314"":""'" "print" "' is a python keyword, renaming to '_" "print" "'",rename="_%s") "print";
%namewarn("314"":""'" "raise" "' is a python keyword, renaming to '_" "raise" "'",rename="_%s") "raise";
%namewarn("314"":""'" "return" "' is a python keyword, renaming to '_" "return" "'",rename="_%s") "return";
%namewarn("314"":""'" "try" "' is a python keyword, renaming to '_" "try" "'",rename="_%s") "try";
%namewarn("314"":""'" "while" "' is a python keyword, renaming to '_" "while" "'",rename="_%s") "while";
%namewarn("314"":""'" "with" "' is a python keyword, renaming to '_" "with" "'",rename="_%s") "with";
%namewarn("314"":""'" "yield" "' is a python keyword, renaming to '_" "yield" "'",rename="_%s") "yield";
/*
built-in functions
https://docs.python.org/2/library/functions.html
*/
%namewarn("321"":""'" "abs" "' conflicts with a built-in name in python", "match$kind"="function" ) "abs";
%namewarn("321"":""'" "apply" "' conflicts with a built-in name in python", "match$kind"="function" ) "apply";
%namewarn("321"":""'" "bool" "' conflicts with a built-in name in python", "match$kind"="function" ) "bool";
%namewarn("321"":""'" "buffer" "' conflicts with a built-in name in python", "match$kind"="function" ) "buffer";
%namewarn("321"":""'" "callable" "' conflicts with a built-in name in python", "match$kind"="function" ) "callable";
%namewarn("321"":""'" "chr" "' conflicts with a built-in name in python", "match$kind"="function" ) "chr";
%namewarn("321"":""'" "classmethod" "' conflicts with a built-in name in python", "match$kind"="function" ) "classmethod";
%namewarn("321"":""'" "cmp" "' conflicts with a built-in name in python", "match$kind"="function" ) "cmp";
%namewarn("321"":""'" "coerce" "' conflicts with a built-in name in python", "match$kind"="function" ) "coerce";
%namewarn("321"":""'" "compile" "' conflicts with a built-in name in python", "match$kind"="function" ) "compile";
%namewarn("321"":""'" "complex" "' conflicts with a built-in name in python", "match$kind"="function" ) "complex";
%namewarn("321"":""'" "delattr" "' conflicts with a built-in name in python", "match$kind"="function" ) "delattr";
%namewarn("321"":""'" "dict" "' conflicts with a built-in name in python", "match$kind"="function" ) "dict";
%namewarn("321"":""'" "dir" "' conflicts with a built-in name in python", "match$kind"="function" ) "dir";
%namewarn("321"":""'" "divmod" "' conflicts with a built-in name in python", "match$kind"="function" ) "divmod";
%namewarn("321"":""'" "enumerate" "' conflicts with a built-in name in python", "match$kind"="function" ) "enumerate";
%namewarn("321"":""'" "eval" "' conflicts with a built-in name in python", "match$kind"="function" ) "eval";
%namewarn("321"":""'" "execfile" "' conflicts with a built-in name in python", "match$kind"="function" ) "execfile";
%namewarn("321"":""'" "file" "' conflicts with a built-in name in python", "match$kind"="function" ) "file";
%namewarn("321"":""'" "filter" "' conflicts with a built-in name in python", "match$kind"="function" ) "filter";
%namewarn("321"":""'" "float" "' conflicts with a built-in name in python", "match$kind"="function" ) "float";
%namewarn("321"":""'" "frozenset" "' conflicts with a built-in name in python", "match$kind"="function" ) "frozenset";
%namewarn("321"":""'" "getattr" "' conflicts with a built-in name in python", "match$kind"="function" ) "getattr";
%namewarn("321"":""'" "globals" "' conflicts with a built-in name in python", "match$kind"="function" ) "globals";
%namewarn("321"":""'" "hasattr" "' conflicts with a built-in name in python", "match$kind"="function" ) "hasattr";
%namewarn("321"":""'" "hash" "' conflicts with a built-in name in python", "match$kind"="function" ) "hash";
%namewarn("321"":""'" "hex" "' conflicts with a built-in name in python", "match$kind"="function" ) "hex";
%namewarn("321"":""'" "id" "' conflicts with a built-in name in python", "match$kind"="function" ) "id";
%namewarn("321"":""'" "input" "' conflicts with a built-in name in python", "match$kind"="function" ) "input";
%namewarn("321"":""'" "int" "' conflicts with a built-in name in python", "match$kind"="function" ) "int";
%namewarn("321"":""'" "intern" "' conflicts with a built-in name in python", "match$kind"="function" ) "intern";
%namewarn("321"":""'" "isinstance" "' conflicts with a built-in name in python", "match$kind"="function" ) "isinstance";
%namewarn("321"":""'" "issubclass" "' conflicts with a built-in name in python", "match$kind"="function" ) "issubclass";
%namewarn("321"":""'" "iter" "' conflicts with a built-in name in python", "match$kind"="function" ) "iter";
%namewarn("321"":""'" "len" "' conflicts with a built-in name in python", "match$kind"="function" ) "len";
%namewarn("321"":""'" "list" "' conflicts with a built-in name in python", "match$kind"="function" ) "list";
%namewarn("321"":""'" "locals" "' conflicts with a built-in name in python", "match$kind"="function" ) "locals";
%namewarn("321"":""'" "long" "' conflicts with a built-in name in python", "match$kind"="function" ) "long";
%namewarn("321"":""'" "map" "' conflicts with a built-in name in python", "match$kind"="function" ) "map";
%namewarn("321"":""'" "max" "' conflicts with a built-in name in python", "match$kind"="function" ) "max";
%namewarn("321"":""'" "min" "' conflicts with a built-in name in python", "match$kind"="function" ) "min";
%namewarn("321"":""'" "object" "' conflicts with a built-in name in python", "match$kind"="function" ) "object";
%namewarn("321"":""'" "oct" "' conflicts with a built-in name in python", "match$kind"="function" ) "oct";
%namewarn("321"":""'" "open" "' conflicts with a built-in name in python", "match$kind"="function" ) "open";
%namewarn("321"":""'" "ord" "' conflicts with a built-in name in python", "match$kind"="function" ) "ord";
%namewarn("321"":""'" "pow" "' conflicts with a built-in name in python", "match$kind"="function" ) "pow";
%namewarn("321"":""'" "property" "' conflicts with a built-in name in python", "match$kind"="function" ) "property";
%namewarn("321"":""'" "range" "' conflicts with a built-in name in python", "match$kind"="function" ) "range";
%namewarn("321"":""'" "raw_input" "' conflicts with a built-in name in python", "match$kind"="function" ) "raw_input";
%namewarn("321"":""'" "reduce" "' conflicts with a built-in name in python", "match$kind"="function" ) "reduce";
%namewarn("321"":""'" "reload" "' conflicts with a built-in name in python", "match$kind"="function" ) "reload";
%namewarn("321"":""'" "repr" "' conflicts with a built-in name in python", "match$kind"="function" ) "repr";
%namewarn("321"":""'" "reversed" "' conflicts with a built-in name in python", "match$kind"="function" ) "reversed";
%namewarn("321"":""'" "round" "' conflicts with a built-in name in python", "match$kind"="function" ) "round";
%namewarn("321"":""'" "set" "' conflicts with a built-in name in python", "match$kind"="function" ) "set";
%namewarn("321"":""'" "setattr" "' conflicts with a built-in name in python", "match$kind"="function" ) "setattr";
%namewarn("321"":""'" "slice" "' conflicts with a built-in name in python", "match$kind"="function" ) "slice";
%namewarn("321"":""'" "sorted" "' conflicts with a built-in name in python", "match$kind"="function" ) "sorted";
%namewarn("321"":""'" "staticmethod" "' conflicts with a built-in name in python", "match$kind"="function" ) "staticmethod";
%namewarn("321"":""'" "str" "' conflicts with a built-in name in python", "match$kind"="function" ) "str";
%namewarn("321"":""'" "sum" "' conflicts with a built-in name in python", "match$kind"="function" ) "sum";
%namewarn("321"":""'" "super" "' conflicts with a built-in name in python", "match$kind"="function" ) "super";
%namewarn("321"":""'" "tuple" "' conflicts with a built-in name in python", "match$kind"="function" ) "tuple";
%namewarn("321"":""'" "type" "' conflicts with a built-in name in python", "match$kind"="function" ) "type";
%namewarn("321"":""'" "unichr" "' conflicts with a built-in name in python", "match$kind"="function" ) "unichr";
%namewarn("321"":""'" "unicode" "' conflicts with a built-in name in python", "match$kind"="function" ) "unicode";
%namewarn("321"":""'" "vars" "' conflicts with a built-in name in python", "match$kind"="function" ) "vars";
%namewarn("321"":""'" "xrange" "' conflicts with a built-in name in python", "match$kind"="function" ) "xrange";
%namewarn("321"":""'" "zip" "' conflicts with a built-in name in python", "match$kind"="function" ) "zip";
/*
built-in names
boolean type and None
*/
%namewarn("321"":""'" "True" "' conflicts with a built-in name in python", "match$kind"="function" ) "True";
%namewarn("321"":""'" "False" "' conflicts with a built-in name in python", "match$kind"="function" ) "False";
%namewarn("314"":""'" "None" "' is a python keyword, renaming to '_" "None" "'",rename="_%s") "None";
/*
'self' is also a bad Name
*/
%namewarn("314"":""'" "self" "' is a python keyword, renaming to '_" "self" "'",rename="_%s") "self";
%endoffile
/* ------------------------------------------------------------
* The Python autodoc support
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pydocs.swg" %beginfile
// Documentation for use with the autodoc feature.
%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)";
// Types to use in Python documentation for the parameters of the given C++ type.
%typemap(doctype) bool "boolean";
/*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,193,%formacro@*//*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,185,%_formacro_1@*//*@SWIG:/usr/share/swig/4.0.0/python/pydocs.swg,30,int_doctype_for_cppint_type@*/
%typemap(doctype) short, unsigned short "int";
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,185,%_formacro_1@*//*@SWIG:/usr/share/swig/4.0.0/python/pydocs.swg,30,int_doctype_for_cppint_type@*/
%typemap(doctype) int, unsigned int "int";
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,185,%_formacro_1@*//*@SWIG:/usr/share/swig/4.0.0/python/pydocs.swg,30,int_doctype_for_cppint_type@*/
%typemap(doctype) long, unsigned long "int";
/*@SWIG@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/swigmacros.swg,185,%_formacro_1@*//*@SWIG:/usr/share/swig/4.0.0/python/pydocs.swg,30,int_doctype_for_cppint_type@*/
%typemap(doctype) long long, unsigned long long "int";
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG@*/
/*@SWIG@*//*@SWIG@*/
%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)"
%endoffile
/* ------------------------------------------------------------
* The Python classes, for C++
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyclasses.swg" %beginfile
%endoffile
/* ------------------------------------------------------------
* The Python initialization function
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pyinit.swg" %beginfile
/* ------------------------------------------------------------
* The start of the Python initialization function
* ------------------------------------------------------------ */
%insert(init) "swiginit.swg"
%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
%}
%insert("init") %{
#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(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
#if PY_VERSION_HEX >= 0x03000000
return PyUnicode_InternFromString("<Swig global variables>");
#else
return PyString_FromString("<Swig global variables>");
#endif
}
SWIGINTERN PyObject *
swig_varlink_str(swig_varlinkobject *v) {
#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(swig_varlinkobject *v) {
swig_globalvar *var = v->vars;
while (var) {
swig_globalvar *n = var->next;
free(var->name);
free(var);
var = n;
}
}
SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject *v, char *n) {
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(swig_varlinkobject *v, char *n, PyObject *p) {
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 */
0, /* tp_print */
(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
#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;
}
SWIGINTERN PyObject *
SWIG_globals(void) {
static PyObject *globals = 0;
if (!globals) {
globals = SWIG_newvarlink();
}
return globals;
}
/* -----------------------------------------------------------------------------
* 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);
}
}
}
/* -----------------------------------------------------------------------------*/
/* Fix SwigMethods to carry the callback ptrs when needed */
/* -----------------------------------------------------------------------------*/
SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef *methods,
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;
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;
}
}
}
}
}
}
/* -----------------------------------------------------------------------------
* 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
/* -----------------------------------------------------------------------------*
* 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);
%}
%endoffile
/* ------------------------------------------------------------
* For backward compatibility
* ------------------------------------------------------------ */
%includefile "/usr/share/swig/4.0.0/python/pybackward.swg" %beginfile
/*
adding backward compatibility macros
*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/primtypes.swg,341,%apply_checkctypes@*/
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {bool},"header", fragment="SWIG_" "AsVal" "_" {bool}) {
SWIGINTERNINLINE bool
SWIG_As_bool (PyObject* obj)
{
bool v;
int res = SWIG_AsVal_bool (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(bool));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {bool},"header",fragment="SWIG_" "AsVal" "_" {bool}) {
SWIGINTERNINLINE int
SWIG_Check_bool (PyObject* obj)
{
int res = SWIG_AsVal_bool (obj, (bool*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {signed char},"header", fragment="SWIG_" "AsVal" "_" {signed char}) {
SWIGINTERNINLINE signed char
SWIG_As_signed_SS_char (PyObject* obj)
{
signed char v;
int res = SWIG_AsVal_signed_SS_char (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(signed char));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {signed char},"header",fragment="SWIG_" "AsVal" "_" {signed char}) {
SWIGINTERNINLINE int
SWIG_Check_signed_SS_char (PyObject* obj)
{
int res = SWIG_AsVal_signed_SS_char (obj, (signed char*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned char},"header", fragment="SWIG_" "AsVal" "_" {unsigned char}) {
SWIGINTERNINLINE unsigned char
SWIG_As_unsigned_SS_char (PyObject* obj)
{
unsigned char v;
int res = SWIG_AsVal_unsigned_SS_char (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned char));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned char},"header",fragment="SWIG_" "AsVal" "_" {unsigned char}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_char (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_char (obj, (unsigned char*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {short},"header", fragment="SWIG_" "AsVal" "_" {short}) {
SWIGINTERNINLINE short
SWIG_As_short (PyObject* obj)
{
short v;
int res = SWIG_AsVal_short (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(short));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {short},"header",fragment="SWIG_" "AsVal" "_" {short}) {
SWIGINTERNINLINE int
SWIG_Check_short (PyObject* obj)
{
int res = SWIG_AsVal_short (obj, (short*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned short},"header", fragment="SWIG_" "AsVal" "_" {unsigned short}) {
SWIGINTERNINLINE unsigned short
SWIG_As_unsigned_SS_short (PyObject* obj)
{
unsigned short v;
int res = SWIG_AsVal_unsigned_SS_short (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned short));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned short},"header",fragment="SWIG_" "AsVal" "_" {unsigned short}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_short (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_short (obj, (unsigned short*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {int},"header", fragment="SWIG_" "AsVal" "_" {int}) {
SWIGINTERNINLINE int
SWIG_As_int (PyObject* obj)
{
int v;
int res = SWIG_AsVal_int (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(int));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {int},"header",fragment="SWIG_" "AsVal" "_" {int}) {
SWIGINTERNINLINE int
SWIG_Check_int (PyObject* obj)
{
int res = SWIG_AsVal_int (obj, (int*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned int},"header", fragment="SWIG_" "AsVal" "_" {unsigned int}) {
SWIGINTERNINLINE unsigned int
SWIG_As_unsigned_SS_int (PyObject* obj)
{
unsigned int v;
int res = SWIG_AsVal_unsigned_SS_int (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned int));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned int},"header",fragment="SWIG_" "AsVal" "_" {unsigned int}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_int (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_int (obj, (unsigned int*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {long},"header", fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERNINLINE long
SWIG_As_long (PyObject* obj)
{
long v;
int res = SWIG_AsVal_long (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(long));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {long},"header",fragment="SWIG_" "AsVal" "_" {long}) {
SWIGINTERNINLINE int
SWIG_Check_long (PyObject* obj)
{
int res = SWIG_AsVal_long (obj, (long*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned long},"header", fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERNINLINE unsigned long
SWIG_As_unsigned_SS_long (PyObject* obj)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned long));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned long},"header",fragment="SWIG_" "AsVal" "_" {unsigned long}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_long (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_long (obj, (unsigned long*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {long long},"header", fragment="SWIG_" "AsVal" "_" {long long}) {
SWIGINTERNINLINE long long
SWIG_As_long_SS_long (PyObject* obj)
{
long long v;
int res = SWIG_AsVal_long_SS_long (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(long long));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {long long},"header",fragment="SWIG_" "AsVal" "_" {long long}) {
SWIGINTERNINLINE int
SWIG_Check_long_SS_long (PyObject* obj)
{
int res = SWIG_AsVal_long_SS_long (obj, (long long*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {unsigned long long},"header", fragment="SWIG_" "AsVal" "_" {unsigned long long}) {
SWIGINTERNINLINE unsigned long long
SWIG_As_unsigned_SS_long_SS_long (PyObject* obj)
{
unsigned long long v;
int res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(unsigned long long));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {unsigned long long},"header",fragment="SWIG_" "AsVal" "_" {unsigned long long}) {
SWIGINTERNINLINE int
SWIG_Check_unsigned_SS_long_SS_long (PyObject* obj)
{
int res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, (unsigned long long*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {float},"header", fragment="SWIG_" "AsVal" "_" {float}) {
SWIGINTERNINLINE float
SWIG_As_float (PyObject* obj)
{
float v;
int res = SWIG_AsVal_float (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(float));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {float},"header",fragment="SWIG_" "AsVal" "_" {float}) {
SWIGINTERNINLINE int
SWIG_Check_float (PyObject* obj)
{
int res = SWIG_AsVal_float (obj, (float*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {double},"header", fragment="SWIG_" "AsVal" "_" {double}) {
SWIGINTERNINLINE double
SWIG_As_double (PyObject* obj)
{
double v;
int res = SWIG_AsVal_double (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(double));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {double},"header",fragment="SWIG_" "AsVal" "_" {double}) {
SWIGINTERNINLINE int
SWIG_Check_double (PyObject* obj)
{
int res = SWIG_AsVal_double (obj, (double*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {char},"header", fragment="SWIG_" "AsVal" "_" {char}) {
SWIGINTERNINLINE char
SWIG_As_char (PyObject* obj)
{
char v;
int res = SWIG_AsVal_char (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(char));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {char},"header",fragment="SWIG_" "AsVal" "_" {char}) {
SWIGINTERNINLINE int
SWIG_Check_char (PyObject* obj)
{
int res = SWIG_AsVal_char (obj, (char*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {wchar_t},"header", fragment="SWIG_" "AsVal" "_" {wchar_t}) {
SWIGINTERNINLINE wchar_t
SWIG_As_wchar_t (PyObject* obj)
{
wchar_t v;
int res = SWIG_AsVal_wchar_t (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(wchar_t));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {wchar_t},"header",fragment="SWIG_" "AsVal" "_" {wchar_t}) {
SWIGINTERNINLINE int
SWIG_Check_wchar_t (PyObject* obj)
{
int res = SWIG_AsVal_wchar_t (obj, (wchar_t*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {size_t},"header", fragment="SWIG_" "AsVal" "_" {size_t}) {
SWIGINTERNINLINE size_t
SWIG_As_size_t (PyObject* obj)
{
size_t v;
int res = SWIG_AsVal_size_t (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(size_t));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {size_t},"header",fragment="SWIG_" "AsVal" "_" {size_t}) {
SWIGINTERNINLINE int
SWIG_Check_size_t (PyObject* obj)
{
int res = SWIG_AsVal_size_t (obj, (size_t*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG:/usr/share/swig/4.0.0/python/pybackward.swg,16,%ascheck_methods@*/
%fragment("SWIG_" "As" "_" {ptrdiff_t},"header", fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) {
SWIGINTERNINLINE ptrdiff_t
SWIG_As_ptrdiff_t (PyObject* obj)
{
ptrdiff_t v;
int res = SWIG_AsVal_ptrdiff_t (obj, &v);
if (!SWIG_IsOK(res)) {
/*
this is needed to make valgrind/purify happier.
*/
memset((void*)&v, 0, sizeof(ptrdiff_t));
SWIG_Error(res, "");
}
return v;
}
}
%fragment("SWIG_" "Check" "_" {ptrdiff_t},"header",fragment="SWIG_" "AsVal" "_" {ptrdiff_t}) {
SWIGINTERNINLINE int
SWIG_Check_ptrdiff_t (PyObject* obj)
{
int res = SWIG_AsVal_ptrdiff_t (obj, (ptrdiff_t*)0);
return SWIG_IsOK(res);
}
}
/*@SWIG@*/;
/*@SWIG@*/
%endoffile
%endoffile
%includefile(maininput="../mapscript.i") "../mapscript.i" %beginfile
/*
===========================================================================
$Id$
Project: MapServer
Purpose: SWIG interface file for the MapServer mapscript module
Author: Steve Lime
Sean Gillies, sgillies@frii.com
===========================================================================
Copyright (c) 1996-2005 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
============================================================================
*/
%module mapscript
%feature("new") msLoadMapFromString;
%{
#include "../../mapserver.h"
#include "../../maptemplate.h"
#include "../../mapogcsld.h"
#include "../../mapows.h"
#include "../../cgiutil.h"
#include "../../mapcopy.h"
#include "../../maperror.h"
#include "../../mapprimitive.h"
#include "../../mapshape.h"
#if defined(WIN32) && defined(SWIGCSHARP)
/* <windows.h> is needed for GetExceptionCode() for unhandled exception */
#include <windows.h>
#endif
%}
/* Problem with SWIG CSHARP typemap for pointers */
%includefile "/usr/share/swig/4.0.0/python/typemaps.i" %beginfile
/* -----------------------------------------------------------------------------
* 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 <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);
*/
// 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).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 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 <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 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.
*/
%includefile "/usr/share/swig/4.0.0/typemaps/typemaps.swg" %beginfile
/* -----------------------------------------------------------------------------
* typemaps.swg
*
* Tcl 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);
*/
// 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 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).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 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 Tcl 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 <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 :
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.
*/
%endoffile
%endoffile
%includefile "/usr/share/swig/4.0.0/constraints.i" %beginfile
/* -----------------------------------------------------------------------------
* constraints.i
*
* SWIG constraints library.
*
* SWIG library file containing typemaps for implementing various kinds of
* constraints. Depends upon the SWIG exception library for generating
* errors in a language-independent manner.
* ----------------------------------------------------------------------------- */
%includefile "/usr/share/swig/4.0.0/python/exception.i" %beginfile
%insert("runtime") {
#define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
}
%endoffile
// Positive numbers
%typemap(check )
int POSITIVE,
short POSITIVE,
long POSITIVE,
unsigned int POSITIVE,
unsigned short POSITIVE,
unsigned long POSITIVE,
signed char POSITIVE,
unsigned char POSITIVE,
float POSITIVE,
double POSITIVE,
Number POSITIVE
{
if ($1 <= 0) {
SWIG_exception(SWIG_ValueError,"Expected a positive value.");
}
}
// Negative numbers
%typemap(check )
int NEGATIVE,
short NEGATIVE,
long NEGATIVE,
unsigned int NEGATIVE,
unsigned short NEGATIVE,
unsigned long NEGATIVE,
signed char NEGATIVE,
unsigned char NEGATIVE,
float NEGATIVE,
double NEGATIVE,
Number NEGATIVE
{
if ($1 >= 0) {
SWIG_exception(SWIG_ValueError,"Expected a negative value.");
}
}
// Nonzero numbers
%typemap(check )
int NONZERO,
short NONZERO,
long NONZERO,
unsigned int NONZERO,
unsigned short NONZERO,
unsigned long NONZERO,
signed char NONZERO,
unsigned char NONZERO,
float NONZERO,
double NONZERO,
Number NONZERO
{
if ($1 == 0) {
SWIG_exception(SWIG_ValueError,"Expected a nonzero value.");
}
}
// Nonnegative numbers
%typemap(check )
int NONNEGATIVE,
short NONNEGATIVE,
long NONNEGATIVE,
unsigned int NONNEGATIVE,
unsigned short NONNEGATIVE,
unsigned long NONNEGATIVE,
signed char NONNEGATIVE,
unsigned char NONNEGATIVE,
float NONNEGATIVE,
double NONNEGATIVE,
Number NONNEGATIVE
{
if ($1 < 0) {
SWIG_exception(SWIG_ValueError,"Expected a non-negative value.");
}
}
// Nonpositive numbers
%typemap(check )
int NONPOSITIVE,
short NONPOSITIVE,
long NONPOSITIVE,
unsigned int NONPOSITIVE,
unsigned short NONPOSITIVE,
unsigned long NONPOSITIVE,
signed char NONPOSITIVE,
unsigned char NONPOSITIVE,
float NONPOSITIVE,
double NONPOSITIVE,
Number NONPOSITIVE
{
if ($1 > 0) {
SWIG_exception(SWIG_ValueError,"Expected a non-positive value.");
}
}
// Non-NULL pointer
%typemap(check )
void * NONNULL,
Pointer NONNULL
{
if (!$1) {
SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
}
}
// Aligned pointers
%typemap(check )
void * ALIGN8,
Pointer ALIGN8
{
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 7) {
SWIG_exception(SWIG_ValueError,"Pointer must be 8-byte aligned.");
}
}
%typemap(check )
void * ALIGN4,
Pointer ALIGN4
{
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 3) {
SWIG_exception(SWIG_ValueError,"Pointer must be 4-byte aligned.");
}
}
%typemap(check )
void * ALIGN2,
Pointer ALIGN2
{
unsigned long long tmp;
tmp = (unsigned long long) $1;
if (tmp & 1) {
SWIG_exception(SWIG_ValueError,"Pointer must be 2-byte aligned.");
}
}
%endoffile
%includefile "/usr/share/swig/4.0.0/python/carrays.i" %beginfile
%includefile "/usr/share/swig/4.0.0/typemaps/carrays.swg" %beginfile
/* -----------------------------------------------------------------------------
* carrays.swg
*
* This library file contains macros that can be used to manipulate simple
* pointers as arrays.
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* %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);
*
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* %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 * cast();
* static NAME *frompointer(TYPE *t);
* }
*
* Use
*
* %array_class_wrap(TYPE,NAME,GET,SET)
*
* if you want different names for the get/set methods.
* ----------------------------------------------------------------------------- */
%endoffile
%endoffile
/*@SWIG:/usr/share/swig/4.0.0/python/carrays.i,1,%array_class@*/
/*@SWIG:/usr/share/swig/4.0.0/typemaps/carrays.swg,69,%array_class_wrap@*/
%{
typedef int intarray;
%}
typedef struct {
} intarray;
%extend intarray {
intarray(size_t nelements) {
return (int *)calloc(nelements, sizeof(int));
}
~intarray() {
free((char*)self);
}
int __getitem__(size_t index) {
return self[index];
}
void __setitem__(size_t index, int value) {
self[index] = value;
}
int * cast() {
return self;
}
static intarray *frompointer(int *t) {
return (intarray *)(t);
}
};
%types(intarray = int);
/*@SWIG@*/
/*@SWIG@*/
/*
===========================================================================
Supporting 'None' as an argument to attribute accessor functions
Typemaps to support NULL in attribute accessor functions
provided to Steve Lime by David Beazley and tested for Python
only by Sean Gillies.
With the use of these typemaps we can execute statements like
layer.group = None
============================================================================
*/
%typemap(memberin) char * {
if ($1) free((char*)$1);
if ($input) {
$1 = ($1_type) malloc(strlen($input)+1);
strcpy((char*)$1,$input);
} else {
$1 = 0;
}
}
%typemap(memberin,warning="451:Setting const char * member may leak
memory.") const char * {
if ($input) {
$1 = ($1_type) malloc(strlen($input)+1);
strcpy((char*)$1,$input);
} else {
$1 = 0;
}
}
%typemap(globalin) char * {
if ($1) free((char*)$1);
if ($input) {
$1 = ($1_type) malloc(strlen($input)+1);
strcpy((char*)$1,$input);
} else {
$1 = 0;
}
}
%typemap(globalin,warning="451:Setting const char * variable may leak
memory.") const char * {
if ($input) {
$1 = ($1_type) malloc(strlen($input)+1);
strcpy((char*)$1,$input);
} else {
$1 = 0;
}
}
/* GD Buffer Mapping for use with imageObj::getBytes */
%{
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
unsigned char *data;
int size;
int owns_data;
} gdBuffer;
#ifdef __cplusplus
}
#endif
%}
/*
============================================================================
Exceptions
Note: Python exceptions are in pymodule.i
============================================================================
*/
/*
============================================================================
Language-specific module code
============================================================================
*/
/* C# */
/* Java */
/* Python */
%includefile "pymodule.i" %beginfile
/******************************************************************************
* Project: MapServer
* Purpose: Python-specific enhancements to MapScript
* Author: Sean Gillies, sgillies@frii.com
*
******************************************************************************
*
* Python-specific mapscript code has been moved into this
* SWIG interface file to improve the readability of the main
* interface file. The main mapscript.i file includes this
* file when SWIGPYTHON is defined (via 'swig -python ...').
*
*****************************************************************************/
/******************************************************************************
* Simple Typemaps
*****************************************************************************/
/* Translates Python None to C NULL for strings */
%typemap(in,parse="z") char * "";
/* To support imageObj::getBytes */
%typemap(out) gdBuffer {
$result = PyBytes_FromStringAndSize((const char*)$1.data, $1.size);
if( $1.owns_data )
msFree($1.data);
}
/*
* Typemap for counted arrays of doubles <- PySequence
*/
%typemap(in,numinputs=1) (int nListSize, double* pListValues)
{
int i;
/* %typemap(in,numinputs=1) (int nListSize, double* pListValues)*/
/* check if is List */
if ( !PySequence_Check($input) ) {
PyErr_SetString(PyExc_TypeError, "not a sequence");
SWIG_fail;
}
$1 = PySequence_Size($input);
$2 = (double*) malloc($1*sizeof(double));
for( i = 0; i<$1; i++ ) {
PyObject *o = PySequence_GetItem($input,i);
if ( !PyArg_Parse(o,"d",&$2[i]) ) {
PyErr_SetString(PyExc_TypeError, "not a number");
Py_DECREF(o);
SWIG_fail;
}
Py_DECREF(o);
}
}
%fragment("CreateTupleFromDoubleArray","header") %{
static PyObject *
CreateTupleFromDoubleArray( double *first, unsigned int size ) {
unsigned int i;
PyObject *out = PyTuple_New( size );
for( i=0; i<size; i++ ) {
PyObject *val = PyFloat_FromDouble( *first );
++first;
PyTuple_SetItem( out, i, val );
}
return out;
}
%}
%typemap(freearg) (int nListSize, double* pListValues)
{
/* %typemap(freearg) (int nListSize, double* pListValues) */
if ($2) {
free((void*) $2);
}
}
%typemap(in,numinputs=0) (double** argout, int* pnListSize) ( double* argout, int nListSize ) {
/* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
$1 = &argout;
$2 = &nListSize;
}
%typemap(argout,fragment="t_output_helper,CreateTupleFromDoubleArray") (double** argout, int* pnListSize)
{
/* %typemap(argout) (double* argout, int* pnListSize) */
PyObject *r;
r = CreateTupleFromDoubleArray(*$1, *$2);
free(*$1);
$result = t_output_helper($result,r);
}
/**************************************************************************
* MapServer Errors and Python Exceptions
**************************************************************************
*
* Translation of errors reported via the ms_error structure into
* Python exceptions. Original code by Chris Chamberlin <cdc@aracnet.com>
* has been updated by Sean Gillies <sgillies@frii.com> to use
* PyErr_SetString, %exception and $action for SWIG 1.3, do the most
* obvious mapping of MapServer errors to Python exceptions and map all
* others to a new 'MapServerError' exception which can be caught like this:
*
* from mapscript import *
* empty_map = mapObj('')
* try:
* img = empty_map.draw()
* except MapServerError, msg:
* print "Caught MapServerError:", msg
*
*************************************************************************/
%{
PyObject *MSExc_MapServerError;
PyObject *MSExc_MapServerChildError;
%}
/* Module initialization: call msSetup() and register msCleanup() */
%insert("init") %{
/* See bug 1203 for discussion of race condition with GD font cache */
if (msSetup() != MS_SUCCESS)
{
msSetError(MS_MISCERR, "Failed to set up threads and font cache",
"msSetup()");
}
Py_AtExit(msCleanup);
/* Define Generic MapServer error */
MSExc_MapServerError=PyErr_NewException("_mapscript.MapServerError",NULL,NULL);
if (MSExc_MapServerError != NULL)
PyDict_SetItemString(d, "MapServerError", MSExc_MapServerError);
/* Define MapServer MS_CHILD error */
MSExc_MapServerChildError = PyErr_NewException("_mapscript.MapServerChildError", NULL, NULL);
if (MSExc_MapServerChildError != NULL)
PyDict_SetItemString(d, "MapServerChildError", MSExc_MapServerChildError);
%}
%{
static void _raise_ms_exception( void );
static void _raise_ms_exception() {
int errcode;
errorObj *ms_error;
char *errmsg;
ms_error = msGetErrorObj();
errcode = ms_error->code;
errmsg = msGetErrorString("\n");
switch (errcode) {
case MS_IOERR:
PyErr_SetString(PyExc_IOError, errmsg);
break;
case MS_MEMERR:
PyErr_SetString(PyExc_MemoryError, errmsg);
break;
case MS_TYPEERR:
PyErr_SetString(PyExc_TypeError, errmsg);
break;
case MS_EOFERR:
PyErr_SetString(PyExc_EOFError, errmsg);
break;
case MS_CHILDERR:
PyErr_SetString(MSExc_MapServerChildError, errmsg);
break;
default:
PyErr_SetString(MSExc_MapServerError, errmsg);
break;
}
free(errmsg);
}
%}
%feature("except") {
$action {
errorObj *ms_error = msGetErrorObj();
switch(ms_error->code) {
case MS_NOERR:
break;
case MS_NOTFOUND:
msResetErrorList();
break;
case -1:
break;
case MS_IOERR:
if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
_raise_ms_exception();
msResetErrorList();
return NULL;
}
default:
_raise_ms_exception();
msResetErrorList();
return NULL;
}
}
}
%insert("python") %{
MapServerError = _mapscript.MapServerError
MapServerChildError = _mapscript.MapServerChildError
%}
/* The bogus "if 1:" is to introduce a new scope to work around indentation
handling with pythonappend in different versions. (#3180) */
%feature("pythonappend") layerObj %{if 1:
self.p_map=None
try:
# python 2.5
if args and len(args)!=0:
self.p_map=args[0]
except NameError:
# python 2.6
if map:
self.p_map=map
%}
/* The bogus "if 1:" is to introduce a new scope to work around indentation
handling with pythonappend in different versions. (#3180) */
%feature("pythonappend") classObj %{if 1:
self.p_layer =None
try:
# python 2.5
if args and len(args)!=0:
self.p_layer=args[0]
except NameError:
# python 2.6
if layer:
self.p_layer=layer
%}
%feature("shadow") insertClass %{
def insertClass(*args):
actualIndex=$action(*args)
args[1].p_layer=args[0]
return actualIndex%}
%feature("shadow") getClass %{
def getClass(*args):
clazz = $action(*args)
if clazz:
if args and len(args)!=0:
clazz.p_layer=args[0]
else:
clazz.p_layer=None
return clazz%}
%feature("shadow") insertLayer %{
def insertLayer(*args):
actualIndex=$action(*args)
args[1].p_map=args[0]
return actualIndex%}
%feature("shadow") getLayer %{
def getLayer(*args):
layer = $action(*args)
if layer:
if args and len(args)!=0:
layer.p_map=args[0]
else:
layer.p_map=None
return layer%}
%feature("shadow") getLayerByName %{
def getLayerByName(*args):
layer = $action(*args)
if layer:
if args and len(args)!=0:
layer.p_map=args[0]
else:
layer.p_map=None
return layer%}
%endoffile
/* Ruby */
/* Perl */
/* Tcl */
/* PHP7 */
/*
=============================================================================
Wrap MapServer structs into mapscript classes
=============================================================================
*/
%includefile "../../mapserver.h" %beginfile
/******************************************************************************
* $Id$
*
* Project: MapServer
* Purpose: Primary MapServer include file.
* Author: Steve Lime and the MapServer team.
*
******************************************************************************
* Copyright (c) 1996-2005 Regents of the University of Minnesota.
*
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of this Software or works derived from this Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
/*
** Main includes. If a particular header was needed by several .c files then
** I just put it here. What the hell, it works and it's all right here. -SDL-
*/
/* definition of ms_int32/ms_uint32 */
typedef int32_t ms_int32;
typedef uint32_t ms_uint32;
/* ms_bitarray is used by the bit mask in mapbit.c */
typedef ms_uint32 * ms_bitarray;
typedef const ms_uint32 *ms_const_bitarray;
/* The regex lib from the system and the regex lib from PHP needs to
* be separated here. We separate here via its directory location.
*/
/* EQUAL and EQUALN are defined in cpl_port.h, so add them in here if ogr was not included */
// hide from swig or ruby will choke on the __FUNCTION__ name
/* General defines, wrapable */
%constant MS_TRUE = 1; /* logical control variables */
%constant MS_FALSE = 0;
%constant MS_UNKNOWN = -1;
%constant MS_ON = 1;
%constant MS_OFF = 0;
%constant MS_DEFAULT = 2;
%constant MS_EMBED = 3;
%constant MS_DELETE = 4;
%constant MS_YES = 1;
%constant MS_NO = 0;
/* Number of layer, class and style ptrs to alloc at once in the
corresponding msGrow...() functions. Replaces former MS_MAXLAYERS,
MS_MAXCLASSES and MS_MAXSTYLES with dynamic allocation (see RFC-17). */
%constant MS_LAYER_ALLOCSIZE = 64;
%constant MS_CLASS_ALLOCSIZE = 8;
%constant MS_STYLE_ALLOCSIZE = 4;
%constant MS_LABEL_ALLOCSIZE = 2; /* not too common */
%constant MS_MAX_LABEL_PRIORITY = 10;
%constant MS_MAX_LABEL_FONTS = 5;
%constant MS_DEFAULT_LABEL_PRIORITY = 1;
%constant MS_LABEL_FORCE_GROUP = 2; /* other values are MS_ON/MS_OFF */
/* General defines, not wrapable */
%constant MS_RENDER_WITH_SWF = 2;
%constant MS_RENDER_WITH_RAWDATA = 3;
%constant MS_RENDER_WITH_IMAGEMAP = 5;
%constant MS_RENDER_WITH_TEMPLATE = 8; /* query results only */
%constant MS_RENDER_WITH_OGR = 16;
%constant MS_RENDER_WITH_PLUGIN = 100;
%constant MS_RENDER_WITH_CAIRO_RASTER = 101;
%constant MS_RENDER_WITH_CAIRO_PDF = 102;
%constant MS_RENDER_WITH_CAIRO_SVG = 103;
%constant MS_RENDER_WITH_OGL = 104;
%constant MS_RENDER_WITH_AGG = 105;
%constant MS_RENDER_WITH_KML = 106;
%constant MS_RENDER_WITH_UTFGRID = 107;
%constant MS_RENDER_WITH_MVT = 108;
/* General enumerated types - needed by scripts */
enum MS_FILE_TYPE {MS_FILE_MAP, MS_FILE_SYMBOL};
enum MS_UNITS {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD, MS_PIXELS, MS_PERCENTAGES, MS_NAUTICALMILES};
enum MS_SHAPE_TYPE {MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, MS_SHAPE_NULL};
enum MS_LAYER_TYPE {MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON, MS_LAYER_RASTER, MS_LAYER_ANNOTATION /* only used for parser backwards compatibility */, MS_LAYER_QUERY, MS_LAYER_CIRCLE, MS_LAYER_TILEINDEX, MS_LAYER_CHART};
enum MS_FONT_TYPE {MS_TRUETYPE, MS_BITMAP};
%constant MS_POSITIONS_LENGTH = 14;
enum MS_POSITIONS_ENUM {MS_UL=101, MS_LR, MS_UR, MS_LL, MS_CR, MS_CL, MS_UC, MS_LC, MS_CC, MS_AUTO, MS_XY, MS_NONE, MS_AUTO2,MS_FOLLOW};
%constant MS_TINY = 5;
%constant MS_SMALL = 7;
%constant MS_MEDIUM = 10;
%constant MS_LARGE = 13;
%constant MS_GIANT = 16;
enum MS_QUERYMAP_STYLES {MS_NORMAL, MS_HILITE, MS_SELECTED};
enum MS_CONNECTION_TYPE {MS_INLINE, MS_SHAPEFILE, MS_TILED_SHAPEFILE, MS_UNUSED_2, MS_OGR, MS_UNUSED_1, MS_POSTGIS, MS_WMS, MS_ORACLESPATIAL, MS_WFS, MS_GRATICULE, MS_MYSQL, MS_RASTER, MS_PLUGIN, MS_UNION, MS_UVRASTER, MS_CONTOUR, MS_KERNELDENSITY };
enum MS_JOIN_CONNECTION_TYPE {MS_DB_XBASE, MS_DB_CSV, MS_DB_MYSQL, MS_DB_ORACLE, MS_DB_POSTGRES};
enum MS_JOIN_TYPE {MS_JOIN_ONE_TO_ONE, MS_JOIN_ONE_TO_MANY};
%constant MS_SINGLE = 0; /* modes for searching (spatial/database) */
%constant MS_MULTIPLE = 1;
enum MS_QUERY_MODE {MS_QUERY_SINGLE, MS_QUERY_MULTIPLE};
enum MS_QUERY_TYPE {MS_QUERY_IS_NULL, MS_QUERY_BY_POINT, MS_QUERY_BY_RECT, MS_QUERY_BY_SHAPE, MS_QUERY_BY_ATTRIBUTE, MS_QUERY_BY_INDEX, MS_QUERY_BY_FILTER};
enum MS_ALIGN_VALUE {MS_ALIGN_DEFAULT, MS_ALIGN_LEFT, MS_ALIGN_CENTER, MS_ALIGN_RIGHT};
enum MS_CAPS_JOINS_AND_CORNERS {MS_CJC_NONE, MS_CJC_BEVEL, MS_CJC_BUTT, MS_CJC_MITER, MS_CJC_ROUND, MS_CJC_SQUARE, MS_CJC_TRIANGLE};
%constant MS_CJC_DEFAULT_JOIN_MAXSIZE = 3;
enum MS_RETURN_VALUE {MS_SUCCESS, MS_FAILURE, MS_DONE};
enum MS_IMAGEMODE { MS_IMAGEMODE_PC256, MS_IMAGEMODE_RGB, MS_IMAGEMODE_RGBA, MS_IMAGEMODE_INT16, MS_IMAGEMODE_FLOAT32, MS_IMAGEMODE_BYTE, MS_IMAGEMODE_FEATURE, MS_IMAGEMODE_NULL };
enum MS_GEOS_OPERATOR {MS_GEOS_EQUALS, MS_GEOS_DISJOINT, MS_GEOS_TOUCHES, MS_GEOS_OVERLAPS, MS_GEOS_CROSSES, MS_GEOS_INTERSECTS, MS_GEOS_WITHIN, MS_GEOS_CONTAINS, MS_GEOS_BEYOND, MS_GEOS_DWITHIN};
/* coordinate to pixel simplification modes, used in msTransformShape */
enum MS_TRANSFORM_MODE {
MS_TRANSFORM_NONE, /* no geographic to pixel transformation */
MS_TRANSFORM_ROUND, /* round to integer, might create degenerate geometries (used for GD)*/
MS_TRANSFORM_SNAPTOGRID, /* snap to a grid, should be user configurable in the future*/
MS_TRANSFORM_FULLRESOLUTION, /* keep full resolution */
MS_TRANSFORM_SIMPLIFY /* keep full resolution */
};
typedef enum {
MS_COMPOP_CLEAR,
MS_COMPOP_SRC,
MS_COMPOP_DST,
MS_COMPOP_SRC_OVER,
MS_COMPOP_DST_OVER,
MS_COMPOP_SRC_IN,
MS_COMPOP_DST_IN,
MS_COMPOP_SRC_OUT,
MS_COMPOP_DST_OUT,
MS_COMPOP_SRC_ATOP,
MS_COMPOP_DST_ATOP,
MS_COMPOP_XOR,
MS_COMPOP_PLUS,
MS_COMPOP_MINUS,
MS_COMPOP_MULTIPLY,
MS_COMPOP_SCREEN,
MS_COMPOP_OVERLAY,
MS_COMPOP_DARKEN,
MS_COMPOP_LIGHTEN,
MS_COMPOP_COLOR_DODGE,
MS_COMPOP_COLOR_BURN,
MS_COMPOP_HARD_LIGHT,
MS_COMPOP_SOFT_LIGHT,
MS_COMPOP_DIFFERENCE,
MS_COMPOP_EXCLUSION,
MS_COMPOP_CONTRAST,
MS_COMPOP_INVERT,
MS_COMPOP_INVERT_RGB
} CompositingOperation;
typedef struct _CompositingFilter{
char *filter;
struct _CompositingFilter *next;
} CompositingFilter;
typedef struct _LayerCompositer{
CompositingOperation comp_op;
int opacity;
CompositingFilter *filter;
struct _LayerCompositer *next;
} LayerCompositer;
/* Define supported bindings here (only covers existing bindings at first). Not accessible directly using MapScript. */
%constant MS_STYLE_BINDING_LENGTH = 12;
enum MS_STYLE_BINDING_ENUM { MS_STYLE_BINDING_SIZE, MS_STYLE_BINDING_WIDTH, MS_STYLE_BINDING_ANGLE, MS_STYLE_BINDING_COLOR, MS_STYLE_BINDING_OUTLINECOLOR, MS_STYLE_BINDING_SYMBOL, MS_STYLE_BINDING_OUTLINEWIDTH, MS_STYLE_BINDING_OPACITY, MS_STYLE_BINDING_OFFSET_X, MS_STYLE_BINDING_OFFSET_Y, MS_STYLE_BINDING_POLAROFFSET_PIXEL, MS_STYLE_BINDING_POLAROFFSET_ANGLE };
%constant MS_LABEL_BINDING_LENGTH = 9;
enum MS_LABEL_BINDING_ENUM { MS_LABEL_BINDING_SIZE, MS_LABEL_BINDING_ANGLE, MS_LABEL_BINDING_COLOR, MS_LABEL_BINDING_OUTLINECOLOR, MS_LABEL_BINDING_FONT, MS_LABEL_BINDING_PRIORITY, MS_LABEL_BINDING_POSITION, MS_LABEL_BINDING_SHADOWSIZEX, MS_LABEL_BINDING_SHADOWSIZEY };
/************************************************************************/
/* attributeBindingObj */
/************************************************************************/
/************************************************************************/
/* labelPathObj */
/* */
/* Label path object - used to hold path and bounds of curved */
/* labels - Bug #1620 implementation. */
/************************************************************************/
/************************************************************************/
/* fontSetObj */
/* */
/* used to hold aliases for TRUETYPE fonts */
/************************************************************************/
typedef struct {
%feature("immutable");
char *filename;
int numfonts;
hashTableObj fonts;
%feature("immutable","");
} fontSetObj;
/************************************************************************/
/* featureListNodeObj */
/* */
/* for inline features, shape caches and queries */
/************************************************************************/
/************************************************************************/
/* paletteObj */
/* */
/* used to hold colors while a map file is read */
/************************************************************************/
/************************************************************************/
/* expressionObj & tokenObj */
/************************************************************************/
enum MS_TOKEN_LOGICAL_ENUM { MS_TOKEN_LOGICAL_AND=300, MS_TOKEN_LOGICAL_OR, MS_TOKEN_LOGICAL_NOT };
enum MS_TOKEN_LITERAL_ENUM { MS_TOKEN_LITERAL_NUMBER=310, MS_TOKEN_LITERAL_STRING, MS_TOKEN_LITERAL_TIME, MS_TOKEN_LITERAL_SHAPE, MS_TOKEN_LITERAL_BOOLEAN };
enum MS_TOKEN_COMPARISON_ENUM {
MS_TOKEN_COMPARISON_EQ=320, MS_TOKEN_COMPARISON_NE, MS_TOKEN_COMPARISON_GT, MS_TOKEN_COMPARISON_LT, MS_TOKEN_COMPARISON_LE, MS_TOKEN_COMPARISON_GE, MS_TOKEN_COMPARISON_IEQ,
MS_TOKEN_COMPARISON_RE, MS_TOKEN_COMPARISON_IRE,
MS_TOKEN_COMPARISON_IN, MS_TOKEN_COMPARISON_LIKE,
MS_TOKEN_COMPARISON_INTERSECTS, MS_TOKEN_COMPARISON_DISJOINT, MS_TOKEN_COMPARISON_TOUCHES, MS_TOKEN_COMPARISON_OVERLAPS, MS_TOKEN_COMPARISON_CROSSES, MS_TOKEN_COMPARISON_WITHIN, MS_TOKEN_COMPARISON_CONTAINS, MS_TOKEN_COMPARISON_EQUALS, MS_TOKEN_COMPARISON_BEYOND, MS_TOKEN_COMPARISON_DWITHIN
};
enum MS_TOKEN_FUNCTION_ENUM {
MS_TOKEN_FUNCTION_LENGTH=350, MS_TOKEN_FUNCTION_TOSTRING, MS_TOKEN_FUNCTION_COMMIFY, MS_TOKEN_FUNCTION_AREA, MS_TOKEN_FUNCTION_ROUND, MS_TOKEN_FUNCTION_FROMTEXT,
MS_TOKEN_FUNCTION_BUFFER, MS_TOKEN_FUNCTION_DIFFERENCE, MS_TOKEN_FUNCTION_SIMPLIFY, MS_TOKEN_FUNCTION_SIMPLIFYPT, MS_TOKEN_FUNCTION_GENERALIZE, MS_TOKEN_FUNCTION_SMOOTHSIA, MS_TOKEN_FUNCTION_JAVASCRIPT,
MS_TOKEN_FUNCTION_UPPER, MS_TOKEN_FUNCTION_LOWER, MS_TOKEN_FUNCTION_INITCAP, MS_TOKEN_FUNCTION_FIRSTCAP
};
enum MS_TOKEN_BINDING_ENUM { MS_TOKEN_BINDING_DOUBLE=370, MS_TOKEN_BINDING_INTEGER, MS_TOKEN_BINDING_STRING, MS_TOKEN_BINDING_TIME, MS_TOKEN_BINDING_SHAPE, MS_TOKEN_BINDING_MAP_CELLSIZE, MS_TOKEN_BINDING_DATA_CELLSIZE };
enum MS_PARSE_TYPE_ENUM { MS_PARSE_TYPE_BOOLEAN, MS_PARSE_TYPE_STRING, MS_PARSE_TYPE_SHAPE };
/* MS RFC 69*/
typedef struct {
double maxdistance; /* max distance between clusters */
double buffer; /* the buffer size around the selection area */
char* region; /* type of the cluster region (rectangle or ellipse) */
} clusterObj;
/************************************************************************/
/* joinObj */
/* */
/* simple way to access other XBase files, one-to-one or */
/* one-to-many supported */
/************************************************************************/
/************************************************************************/
/* outputFormatObj */
/* */
/* see mapoutput.c for most related code. */
/************************************************************************/
typedef struct {
%feature("immutable");
int numformatoptions;
%feature("immutable","");
char *name;
char *mimetype;
char *driver;
char *extension;
int renderer; /* MS_RENDER_WITH_* */
int imagemode; /* MS_IMAGEMODE_* value. */
int transparent;
int bands;
int inmapfile; /* boolean value for writing */
} outputFormatObj;
/* The following is used for "don't care" values in transparent, interlace and
imagequality values. */
%constant MS_NOOVERRIDE = -1111;
/***
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment