add implicitconv support and cosmetics for cast rank
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8095 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e4e72e63fa
commit
0e4b388ec9
24 changed files with 484 additions and 308 deletions
|
|
@ -31,7 +31,7 @@
|
|||
%define Name ## _input_binary(TYPEMAP, SIZE)
|
||||
%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) (TYPEMAP, SIZE)
|
||||
(Char *buf = 0, size_t size = 0, int alloc = 0) {
|
||||
if (SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $argnum);
|
||||
}
|
||||
$1 = ($1_ltype) buf;
|
||||
|
|
@ -61,7 +61,6 @@
|
|||
%typemap(in,noblock=1,numinputs=0) TYPEMAP (Char temp[MAX+1]) {
|
||||
$1 = ($1_ltype) temp;
|
||||
}
|
||||
%typemap(freearg,noblock=1) TYPEMAP "";
|
||||
%typemap(argout,noblock=1,fragment= #SWIG_FromCharPtr ) TYPEMAP {
|
||||
$1[MAX] = 0;
|
||||
%append_output(SWIG_FromCharPtr($1));
|
||||
|
|
@ -87,7 +86,6 @@
|
|||
%typemap(in,noblock=1,numinputs=0) TYPEMAP(Char temp[SIZE]) {
|
||||
$1 = ($1_ltype) temp;
|
||||
}
|
||||
%typemap(freearg,noblock=1) TYPEMAP "";
|
||||
%typemap(argout,noblock=1,fragment= #SWIG_FromCharPtrAndSize) TYPEMAP {
|
||||
%append_output(SWIG_FromCharPtrAndSize($1,SIZE));
|
||||
}
|
||||
|
|
@ -114,7 +112,7 @@
|
|||
%define Name ## _bounded_mutable(TYPEMAP,MAX)
|
||||
%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) TYPEMAP
|
||||
(Char temp[MAX+1], Char *t = 0, size_t n = 0, int alloc = 0) {
|
||||
if (SWIG_AsCharPtrAndSize($input, &t, &n, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &t, &n, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError, "TYPEMAP", $argnum);
|
||||
}
|
||||
if ( n > (size_t) MAX ) n = (size_t) MAX;
|
||||
|
|
@ -123,7 +121,6 @@
|
|||
temp[n - 1] = 0;
|
||||
$1 = ($1_ltype) temp;
|
||||
}
|
||||
%typemap(freearg,noblock=1) TYPEMAP "";
|
||||
%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP {
|
||||
$1[MAX] = 0;
|
||||
%append_output(SWIG_FromCharPtr($1));
|
||||
|
|
@ -153,7 +150,7 @@
|
|||
#if #EXP != ""
|
||||
expansion += EXP;
|
||||
#endif
|
||||
if (SWIG_AsCharPtrAndSize($input, &t, &n, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &t, &n, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError, "TYPEMAP", $argnum);
|
||||
}
|
||||
$1 = %new_array(n+expansion, $*1_ltype);
|
||||
|
|
@ -161,7 +158,6 @@
|
|||
if (alloc == SWIG_NEWOBJ) %delete_array(t);
|
||||
$1[n-1] = 0;
|
||||
}
|
||||
%typemap(freearg,noblock=1) TYPEMAP "";
|
||||
%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP {
|
||||
%append_output(SWIG_FromCharPtr($1));
|
||||
%delete_array($1);
|
||||
|
|
@ -246,7 +242,6 @@
|
|||
%typemap(in,noblock=1,numinputs=0) TYPEMAP($*1_ltype temp = 0) {
|
||||
$1 = &temp;
|
||||
}
|
||||
%typemap(freearg) TYPEMAP "";
|
||||
%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP {
|
||||
if (*$1) {
|
||||
%append_output(SWIG_FromCharPtr(*$1));
|
||||
|
|
@ -274,7 +269,6 @@
|
|||
%typemap(in,noblock=1,numinputs=0) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) {
|
||||
$1 = &temp; $2 = &tempn;
|
||||
}
|
||||
%typemap(freearg) (TYPEMAP,SIZE) "";
|
||||
%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtrAndSize)(TYPEMAP,SIZE) {
|
||||
if (*$1) {
|
||||
%append_output(SWIG_FromCharPtrAndSize(*$1,*$2));
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
$1 = &temp;
|
||||
}
|
||||
}
|
||||
%typemap(freearg) const enum SWIGTYPE& "";
|
||||
|
||||
%typemap(varin,fragment=SWIG_AsVal_frag(int),noblock=1) enum SWIGTYPE {
|
||||
if (sizeof(int) != sizeof($1)) {
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@
|
|||
%define %implicit_code(Type...)
|
||||
if (SWIG_IsOK(swig::asval<Type >(obj, 0))) {
|
||||
Type _v;
|
||||
swig::asval<Type >(obj, &_v);
|
||||
int res = swig::asval<Type >(obj, &_v);
|
||||
if (val) *val = %new_copy(_v, value_type);
|
||||
return SWIG_NEWOBJ;
|
||||
return SWIG_AddNewMask(res);
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
|
@ -72,13 +72,14 @@ namespace swig {
|
|||
static int asptr(SWIG_Object obj, value_type **val) {
|
||||
Type *vptr;
|
||||
static swig_type_info* desc = SWIG_TypeQuery("Type *");
|
||||
if ((SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0) == SWIG_OK)) {
|
||||
int res = SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0);
|
||||
if (SWIG_IsOK(res)) {
|
||||
if (val) *val = vptr;
|
||||
return SWIG_OLDOBJ;
|
||||
return res;
|
||||
} else {
|
||||
%formacro_1(%implicit_code,__VA_ARGS__)
|
||||
}
|
||||
return 0;
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -107,13 +108,14 @@ namespace swig {
|
|||
static int asptr(SWIG_Object obj, value_type **val) {
|
||||
Type *vptr;
|
||||
static swig_type_info* desc = SWIG_TypeQuery("Type *");
|
||||
if ((SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0) == SWIG_OK)) {
|
||||
int res = SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0);
|
||||
if (SWIG_IsOK(res)) {
|
||||
if (val) *val = vptr;
|
||||
return SWIG_OLDOBJ;
|
||||
return res;
|
||||
} else {
|
||||
%implicit_code(Imp1);
|
||||
}
|
||||
return 0;
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -144,14 +146,15 @@ namespace swig {
|
|||
static int asptr(SWIG_Object obj, value_type **val) {
|
||||
Type *vptr;
|
||||
static swig_type_info* desc = SWIG_TypeQuery("Type *");
|
||||
if ((SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0) == SWIG_OK)) {
|
||||
int res = SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0);
|
||||
if (SWIG_IsOK(res)) {
|
||||
if (val) *val = vptr;
|
||||
return SWIG_OLDOBJ;
|
||||
} else {
|
||||
%implicit_code(Imp1);
|
||||
%implicit_code(Imp2);
|
||||
}
|
||||
return 0;
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -184,15 +187,16 @@ namespace swig {
|
|||
static int asptr(SWIG_Object obj, value_type **val) {
|
||||
Type *vptr;
|
||||
static swig_type_info* desc = SWIG_TypeQuery("Type *");
|
||||
if ((SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0) == SWIG_OK)) {
|
||||
int res = SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0);
|
||||
if (SWIG_IsOK(res)) {
|
||||
if (val) *val = vptr;
|
||||
return SWIG_OLDOBJ;
|
||||
return res;
|
||||
} else {
|
||||
%implicit_code(Imp1);
|
||||
%implicit_code(Imp2);
|
||||
%implicit_code(Imp3);
|
||||
}
|
||||
return 0;
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,13 +71,13 @@ or you can use the %apply directive :
|
|||
|
||||
*/
|
||||
#if defined(SWIG_INPUT_ACCEPT_PTRS)
|
||||
#define %check_input_ptr(input,arg,desc,disown) (SWIG_ConvertPtr(input,%as_voidptrptr(arg),desc,disown) == SWIG_OK)
|
||||
#define %check_input_ptr(input,arg,desc,disown) (SWIG_IsOK(res = SWIG_ConvertPtr(input,%as_voidptrptr(arg),desc,disown)))
|
||||
#else
|
||||
#define %check_input_ptr(input,arg,desc,disown) (0)
|
||||
#define %check_input_ptr(input,arg,desc,disown) (SWIG_IsOK(res = SWIG_ERROR))
|
||||
#endif
|
||||
|
||||
%define %_value_input_typemap(code, asval_meth, asval_frag, Type)
|
||||
%typemap(in,noblock=1,fragment=asval_frag) Type *INPUT ($*ltype temp, int res = 0) {
|
||||
%typemap(in,noblock=1,fragment=asval_frag) Type *INPUT ($*ltype temp, int res) {
|
||||
if (!%check_input_ptr($input,&$1,$descriptor,$disown)) {
|
||||
Type val;
|
||||
int ecode = asval_meth($input, &val);
|
||||
|
|
@ -86,10 +86,10 @@ or you can use the %apply directive :
|
|||
}
|
||||
temp = %static_cast(val, $*ltype);
|
||||
$1 = &temp;
|
||||
res = SWIG_NEWOBJ;
|
||||
res = SWIG_AddTmpMask(ecode);
|
||||
}
|
||||
}
|
||||
%typemap(in,noblock=1,fragment=asval_frag) Type &INPUT($*ltype temp, int res = 0) {
|
||||
%typemap(in,noblock=1,fragment=asval_frag) Type &INPUT($*ltype temp, int res) {
|
||||
if (!%check_input_ptr($input,&$1,$descriptor,$disown)) {
|
||||
Type val;
|
||||
int ecode = asval_meth($input, &val);
|
||||
|
|
@ -98,41 +98,46 @@ or you can use the %apply directive :
|
|||
}
|
||||
temp = %static_cast(val, $*ltype);
|
||||
$1 = &temp;
|
||||
res = SWIG_NEWOBJ;
|
||||
res = SWIG_AddTmpMask(ecode);
|
||||
}
|
||||
}
|
||||
%typemap(freearg,noblock=1,match="in") Type *INPUT, Type &INPUT {
|
||||
if (SWIG_IsNewObj(res$argnum)) %delete($1);
|
||||
}
|
||||
%typemap(typecheck,noblock=1,precedence=code,fragment=asval_frag) Type *INPUT, Type &INPUT {
|
||||
void *ptr;
|
||||
int res = SWIG_CastRank(asval_meth($input, 0));
|
||||
if (SWIG_IsOK(res)) {
|
||||
$1 = res;
|
||||
} else {
|
||||
int res = asval_meth($input, 0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
if (!$1) {
|
||||
$1 = %check_input_ptr($input,&ptr,$1_descriptor,0);
|
||||
}
|
||||
}
|
||||
%enddef
|
||||
|
||||
%define %_ptr_input_typemap(code,asptr_meth,asptr_frag,Type)
|
||||
%typemap(in,noblock=1,fragment=asptr_frag) Type *INPUT(int res = 0) {
|
||||
%typemap(in,noblock=1,fragment=asptr_frag) Type *INPUT(int res) {
|
||||
res = asptr_meth($input, &$1);
|
||||
if (!res) {
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
res = SWIG_AddTmpMask(res);
|
||||
}
|
||||
%typemap(in,noblock=1,fragment=asptr_frag) Type &INPUT(int res = 0) {
|
||||
%typemap(in,noblock=1,fragment=asptr_frag) Type &INPUT(int res) {
|
||||
res = asptr_meth($input, &$1);
|
||||
if (!res) {
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
if (!$1) {
|
||||
%argument_nullref("$type",$argnum);
|
||||
}
|
||||
res = SWIG_AddTmpMask(res);
|
||||
}
|
||||
%typemap(freearg,noblock=1) Type *INPUT, Type &INPUT {
|
||||
if (res$argnum == SWIG_NEWOBJ) %delete($1);
|
||||
%typemap(freearg,noblock=1,match="in") Type *INPUT, Type &INPUT {
|
||||
if (SWIG_IsNewObj(res$argnum)) %delete($1);
|
||||
}
|
||||
%typemap(typecheck,noblock=1,precedence=code,fragment=asptr_frag) Type *INPUT, Type &INPUT {
|
||||
$1 = asptr_meth($input, (Type**)0) != 0;
|
||||
int res = asptr_meth($input, (Type**)0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
|
@ -174,10 +179,11 @@ values.
|
|||
$1 = &temp;
|
||||
}
|
||||
%typemap(argout,noblock=1,fragment=from_frag) Type *OUTPUT, Type &OUTPUT {
|
||||
if (res$argnum == SWIG_NEWOBJ) {
|
||||
if (SWIG_IsTmpObj(res$argnum)) {
|
||||
%append_output(from_meth((*$1)));
|
||||
} else {
|
||||
%append_output(SWIG_NewPointerObj((void*)($1), $1_descriptor, %newpointer_flags));
|
||||
int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | %newpointer_flags) : %newpointer_flags;
|
||||
%append_output(SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags));
|
||||
}
|
||||
}
|
||||
%enddef
|
||||
|
|
@ -233,6 +239,8 @@ phased out in future releases.
|
|||
|
||||
%define %_ptr_inout_typemap(Type)
|
||||
%_value_inout_typemap(%arg(Type))
|
||||
%typemap(typecheck) Type *INOUT = Type *INPUT;
|
||||
%typemap(typecheck) Type &INOUT = Type &INPUT;
|
||||
%typemap(freearg) Type *INOUT = Type *INPUT;
|
||||
%typemap(freearg) Type &INOUT = Type &INPUT;
|
||||
%enddef
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ SWIGINTERN int
|
|||
SWIG_AsVal_dec(bool)(SWIG_Object obj, bool *val)
|
||||
{
|
||||
long v;
|
||||
int res = SWIG_IsOK(SWIG_AsVal(long)(obj, val ? &v : 0));
|
||||
int res = SWIG_AsVal(long)(obj, val ? &v : 0);
|
||||
if (SWIG_IsOK(res)) {
|
||||
if (val) *val = v ? true : false;
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -28,20 +28,20 @@
|
|||
%typemap(in,fragment=frag) Type {
|
||||
Type *ptr = (Type *)0;
|
||||
int res = asptr_meth($input, &ptr);
|
||||
if (!res || !ptr) { %argument_fail(SWIG_TypeError, "$type", $argnum); }
|
||||
if (!SWIG_IsOK(res) || !ptr) { %argument_fail(SWIG_TypeError, "$type", $argnum); }
|
||||
$1 = *ptr;
|
||||
if (res == SWIG_NEWOBJ) %delete(ptr);
|
||||
if (SWIG_IsNewObj(res)) %delete(ptr);
|
||||
}
|
||||
%typemap(freearg) Type "";
|
||||
%typemap(in,fragment=frag) const Type & (int res = 0) {
|
||||
%typemap(in,fragment=frag) const Type & (int res = SWIG_OLDOBJ) {
|
||||
Type *ptr = (Type *)0;
|
||||
res = asptr_meth($input, &ptr);
|
||||
if (!res) { %argument_fail(SWIG_TypeError,"$type",$argnum); }
|
||||
if (!SWIG_IsOK(res)) { %argument_fail(SWIG_TypeError,"$type",$argnum); }
|
||||
if (!ptr) { %argument_nullref("$type",$argnum); }
|
||||
$1 = ptr;
|
||||
}
|
||||
%typemap(freearg,noblock=1) const Type & {
|
||||
if (res$argnum == SWIG_NEWOBJ) %delete($1);
|
||||
if (SWIG_IsNewObj(res$argnum)) %delete($1);
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
|
@ -51,9 +51,11 @@
|
|||
%typemap(varin,fragment=frag) Type {
|
||||
Type *ptr = (Type *)0;
|
||||
int res = asptr_meth($input, &ptr);
|
||||
if (!res || !ptr) { %variable_fail(SWIG_TypeError, "$type", "$name"); }
|
||||
if (!SWIG_IsOK(res) || !ptr) { %variable_fail(SWIG_TypeError, "$type", "$name"); }
|
||||
$1 = *ptr;
|
||||
if (res == SWIG_NEWOBJ) %delete(ptr);
|
||||
if (SWIG_IsNewObj(res)) {
|
||||
%delete(ptr);
|
||||
}
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
|
@ -64,32 +66,32 @@
|
|||
%typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT ($*ltype temp) {
|
||||
Type *optr = 0;
|
||||
int ores = $input ? asptr_meth($input, &optr) : 0;
|
||||
if (!ores || !optr) {
|
||||
if (!SWIG_IsOK(ores) || !optr) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
temp = *optr;
|
||||
$result = &temp;
|
||||
if (ores == SWIG_NEWOBJ) %delete(optr);
|
||||
if (SWIG_IsNewObj(ores)) %delete(optr);
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,fragment=frag) Type {
|
||||
Type *optr = 0;
|
||||
int ores = asptr_meth($input, &optr);
|
||||
if (!ores || !optr) {
|
||||
if (!SWIG_IsOK(ores) || !optr) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = *optr;
|
||||
if (ores == SWIG_NEWOBJ) %delete(optr);
|
||||
if (SWIG_IsNewObj(ores)) %delete(optr);
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) Type* {
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) Type* {
|
||||
Type *optr = 0;
|
||||
int ores = asptr_meth($input, &optr);
|
||||
if (!ores) {
|
||||
if (!SWIG_IsOK(ores)) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = optr;
|
||||
if (ores == SWIG_NEWOBJ) {
|
||||
if (SWIG_IsNewObj(ores)) {
|
||||
swig_acquire_ownership(optr);
|
||||
}
|
||||
}
|
||||
|
|
@ -100,10 +102,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) Type& {
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) Type& {
|
||||
Type *optr = 0;
|
||||
int ores = asptr_meth($input, &optr);
|
||||
if (!ores) {
|
||||
if (!SWIG_IsOK(ores)) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
} else {
|
||||
if (!optr) {
|
||||
|
|
@ -111,7 +113,7 @@
|
|||
}
|
||||
}
|
||||
$result = optr;
|
||||
if (ores == SWIG_NEWOBJ) {
|
||||
if (SWIG_IsNewObj(ores)) {
|
||||
swig_acquire_ownership(optr);
|
||||
}
|
||||
}
|
||||
|
|
@ -136,12 +138,15 @@
|
|||
/* typecheck */
|
||||
|
||||
%define %ptr_typecheck_typemap(check,asptr_meth,frag,Type...)
|
||||
%typemap(typecheck,precedence=check,fragment=frag)
|
||||
Type *
|
||||
"$1 = asptr_meth($input, (Type**)(0)) != 0;";
|
||||
%typemap(typecheck,precedence=check,fragment=frag)
|
||||
Type, const Type&
|
||||
"$1 = asptr_meth($input, (Type**)(0)) != 0;";
|
||||
%typemap(typecheck,noblock=1,precedence=check,fragment=frag) Type * {
|
||||
int res = asptr_meth($input, (Type**)(0));
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
%typemap(typecheck,noblock=1,precedence=check,fragment=frag) Type, const Type& {
|
||||
int res = asptr_meth($input, (Type**)(0));
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
||||
|
|
@ -156,12 +161,16 @@
|
|||
{
|
||||
Type *v = (Type *)0;
|
||||
int res = SWIG_AsPtr(Type)(obj, &v);
|
||||
if (!res || !v) return SWIG_ERROR;
|
||||
if (val) {
|
||||
*val = *v;
|
||||
if (res == SWIG_NEWOBJ) %delete(v);
|
||||
if (!SWIG_IsOK(res)) return res;
|
||||
if (v) {
|
||||
if (val) *val = *v;
|
||||
if (SWIG_IsNewObj(res)) {
|
||||
%delete(v);
|
||||
res = SWIG_DelNewMask(res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return SWIG_OK;
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
}
|
||||
%ptr_in_typemap(%arg(AsPtrMeth), %arg(AsPtrFrag), Type);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ SWIGINTERN int
|
|||
SWIG_AsPtr_dec(String)(SWIG_Object obj, String **val)
|
||||
{
|
||||
Char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
|
||||
if (SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc) == SWIG_OK) {
|
||||
if (SWIG_IsOK(SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc))) {
|
||||
if (buf) {
|
||||
if (val) *val = new String(buf, size - 1);
|
||||
if (alloc == SWIG_NEWOBJ) %delete_array(buf);
|
||||
|
|
@ -24,14 +24,13 @@ SWIG_AsPtr_dec(String)(SWIG_Object obj, String **val)
|
|||
init = 1;
|
||||
}
|
||||
if (descriptor) {
|
||||
String *vptr;
|
||||
if ((SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0) == SWIG_OK)) {
|
||||
if (val) *val = vptr;
|
||||
return SWIG_OLDOBJ;
|
||||
}
|
||||
String *vptr;
|
||||
int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
|
||||
if (SWIG_IsOK(res) && val) *val = vptr;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
}
|
||||
%enddef
|
||||
|
|
@ -51,14 +50,18 @@ SWIG_From_dec(String)(const String& s)
|
|||
SWIGINTERN int
|
||||
SWIG_AsVal_dec(String)(SWIG_Object obj, String *val)
|
||||
{
|
||||
String* s;
|
||||
int res = SWIG_AsPtr(String)(obj, &s);
|
||||
if ((res != 0) && s) {
|
||||
if (val) *val = *s;
|
||||
if (res == SWIG_NEWOBJ) delete s;
|
||||
return SWIG_OK;
|
||||
String* v = (String *) 0;
|
||||
int res = SWIG_AsPtr(String)(obj, &v);
|
||||
if (!SWIG_IsOK(res)) return res;
|
||||
if (v) {
|
||||
if (val) *val = *v;
|
||||
if (SWIG_IsNewObj(res)) {
|
||||
%delete(v);
|
||||
res = SWIG_DelNewMask(res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return SWIG_TypeError;
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
}
|
||||
%enddef
|
||||
|
|
|
|||
|
|
@ -30,22 +30,22 @@
|
|||
%typemap(in,noblock=1,fragment=#SWIG_AsCharPtr)
|
||||
Char * (Char *buf = 0, int alloc = 0),
|
||||
const Char * (Char *buf = 0, int alloc = 0) {
|
||||
if (SWIG_AsCharPtr($input, &buf, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtr($input, &buf, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = buf;
|
||||
}
|
||||
%typemap(freearg,noblock=1) Char *, const Char * {
|
||||
%typemap(freearg,noblock=1,match="in") Char *, const Char * {
|
||||
if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
|
||||
}
|
||||
|
||||
%typemap(in,noblock=1,fragment=#SWIG_AsCharPtr) Char const*& (Char *buf = 0, int alloc = 0) {
|
||||
if (SWIG_AsCharPtr($input, &buf, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtr($input, &buf, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
}
|
||||
%typemap(freearg, noblock=1) Char const*& {
|
||||
%typemap(freearg, noblock=1,match="in") Char const*& {
|
||||
if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
%typemap(varin,noblock=1,fragment=#SWIG_AsCharPtrAndSize) Char * {
|
||||
Char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ;
|
||||
if (SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc))) {
|
||||
%variable_fail(SWIG_TypeError,"$type","$name");
|
||||
}
|
||||
if ($1) %delete_array($1);
|
||||
|
|
@ -76,9 +76,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
%typemap(varin,noblock=1,fragment=#SWIG_AsCharPtrAndSize,warning="451:Setting const Char * variable may leak memory") const Char * {
|
||||
%typemap(varin,noblock=1,fragment=#SWIG_AsCharPtrAndSize,warning=SWIG_WARN_TYPEMAP_CHARLEAK) const Char * {
|
||||
Char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ;
|
||||
if (SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
if (alloc == SWIG_NEWOBJ) {
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
%typemap(memberin,noblock=1,warning="451:Setting const char * member may leak memory.") const Char * {
|
||||
%typemap(memberin,noblock=1,warning=SWIG_WARN_TYPEMAP_CHARLEAK) const Char * {
|
||||
if ($input) {
|
||||
size_t size = SWIG_CharPtrLen($input) + 1;
|
||||
$1 = %new_copy_array($input, size, Char);
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
%typemap(globalin,noblock=1,warning="451:Setting const char * variable may leak memory.") const Char * {
|
||||
%typemap(globalin,noblock=1,warning=SWIG_WARN_TYPEMAP_CHARLEAK) const Char * {
|
||||
if ($input) {
|
||||
size_t size = SWIG_CharPtrLen($input) + 1;
|
||||
$1 = %new_copy_array($input, size, Char);
|
||||
|
|
@ -157,9 +157,9 @@
|
|||
|
||||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE)
|
||||
%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR)
|
||||
Char * (Char* buf = 0, int alloc = SWIG_NEWOBJ) {
|
||||
if (SWIG_AsCharPtr($input, &buf, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtr($input, &buf, &alloc))) {
|
||||
%dirout_fail(SWIG_TypeError, "$type");
|
||||
}
|
||||
if (alloc == SWIG_NEWOBJ) {
|
||||
|
|
@ -175,10 +175,10 @@
|
|||
}
|
||||
|
||||
|
||||
%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE)
|
||||
%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR)
|
||||
Char * const& (Char* buf = 0, int alloc = SWIG_NEWOBJ),
|
||||
Char const* const& (Char* buf = 0, int alloc = SWIG_NEWOBJ) {
|
||||
if (SWIG_AsCharPtr($input, &buf, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtr($input, &buf, &alloc))) {
|
||||
%dirout_fail(SWIG_TypeError, "$type");
|
||||
}
|
||||
static $*ltype tmp = buf;
|
||||
|
|
@ -200,7 +200,8 @@
|
|||
|
||||
%typemap(typecheck,noblock=1,precedence=SWIG_TYPECHECK_STRING,
|
||||
fragment=#SWIG_AsCharPtr) Char *, Char const*& {
|
||||
$1 = (SWIG_AsCharPtr($input, 0, 0) == SWIG_OK);
|
||||
int res = SWIG_AsCharPtr($input, 0, 0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -248,7 +249,7 @@
|
|||
Char [ANY] (Char temp[$1_dim0]),
|
||||
const Char [ANY](Char temp[$1_dim0])
|
||||
{
|
||||
if (SWIG_AsCharArray($input, temp, $1_dim0) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharArray($input, temp, $1_dim0))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = temp;
|
||||
|
|
@ -257,7 +258,7 @@
|
|||
|
||||
%typemap(in,noblock=1,fragment=#SWIG_AsCharArray) const Char (&)[ANY] (Char temp[$1_dim0])
|
||||
{
|
||||
if (SWIG_AsCharArray($input, temp, $1_dim0) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharArray($input, temp, $1_dim0))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
|
|
@ -278,7 +279,7 @@
|
|||
|
||||
%typemap(varin,noblock=1,fragment=#SWIG_AsCharArray) Char [ANY]
|
||||
{
|
||||
if (SWIG_AsCharArray($input, $1, $1_dim0) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharArray($input, $1, $1_dim0))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
}
|
||||
|
|
@ -326,7 +327,7 @@
|
|||
Char [ANY] (Char temp[$result_dim0]),
|
||||
const Char [ANY] (Char temp[$result_dim0])
|
||||
{
|
||||
if (SWIG_AsCharArray($input, temp, $result_dim0) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharArray($input, temp, $result_dim0))) {
|
||||
%dirout_fail(SWIG_TypeError, "$type");
|
||||
}
|
||||
$result = temp;
|
||||
|
|
@ -339,7 +340,8 @@
|
|||
%typemap(typecheck,noblock=1,precedence=SWIG_TYPECHECK_STRING,
|
||||
fragment=#SWIG_AsCharArray)
|
||||
Char [ANY], const Char[ANY] {
|
||||
$1 = (SWIG_AsCharArray($input, (Char *)0, $1_dim0) == SWIG_OK);
|
||||
int res = SWIG_AsCharArray($input, (Char *)0, $1_dim0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -395,13 +397,13 @@
|
|||
(Char *STRING, size_t LENGTH) (Char *buf = 0, size_t size = 0, int alloc = 0),
|
||||
(const Char *STRING, size_t LENGTH) (Char *buf = 0, size_t size = 0, int alloc = 0)
|
||||
{
|
||||
if (SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = %static_cast(buf, $1_ltype);
|
||||
$2 = %numeric_cast(size - 1, $2_ltype);
|
||||
}
|
||||
%typemap(freearg,noblock=1) (Char *STRING, size_t LENGTH) {
|
||||
%typemap(freearg,noblock=1,match="in") (Char *STRING, size_t LENGTH) {
|
||||
if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
|
||||
}
|
||||
/* old 'int' form */
|
||||
|
|
@ -414,13 +416,13 @@
|
|||
(Char *STRING, size_t SIZE) (Char *buf = 0, size_t size = 0, int alloc = 0),
|
||||
(const Char *STRING, size_t SIZE) (Char *buf = 0, size_t size = 0, int alloc = 0)
|
||||
{
|
||||
if (SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$1 = %static_cast(buf, $1_ltype);
|
||||
$2 = %numeric_cast(size, $2_ltype);
|
||||
}
|
||||
%typemap(freearg, noblock=1) (Char *STRING, size_t SIZE) {
|
||||
%typemap(freearg, noblock=1,match="in") (Char *STRING, size_t SIZE) {
|
||||
if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
|
||||
}
|
||||
/* old 'int' form */
|
||||
|
|
@ -435,13 +437,13 @@
|
|||
(size_t LENGTH, Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0),
|
||||
(size_t LENGHT, const Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0)
|
||||
{
|
||||
if (SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
$2 = %static_cast(buf, $2_ltype) ;
|
||||
$1 = %numeric_cast(size - 1, $1_ltype) ;
|
||||
}
|
||||
%typemap(freearg, noblock=1) (size_t LENGTH, Char *STRING) {
|
||||
%typemap(freearg, noblock=1, match="in") (size_t LENGTH, Char *STRING) {
|
||||
if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
|
||||
}
|
||||
/* old 'int' form */
|
||||
|
|
@ -453,13 +455,13 @@
|
|||
(size_t SIZE, Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0),
|
||||
(size_t SIZE, const Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0)
|
||||
{
|
||||
if (SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc))) {
|
||||
%argument_fail(SWIG_TypeError, "$type",$argnum);
|
||||
}
|
||||
$2 = %static_cast(buf, $2_ltype) ;
|
||||
$1 = %numeric_cast(size, $1_ltype) ;
|
||||
}
|
||||
%typemap(freearg, noblock=1) (size_t SIZE, Char *STRING) {
|
||||
%typemap(freearg, noblock=1, match="in") (size_t SIZE, Char *STRING) {
|
||||
if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
|
||||
}
|
||||
/* old 'int' form */
|
||||
|
|
@ -506,15 +508,19 @@ SWIGINTERN int
|
|||
SWIG_As##CharName##Array(SWIG_Object obj, Char *val, size_t size)
|
||||
{
|
||||
Char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
|
||||
if (SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc) == SWIG_OK) {
|
||||
int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
|
||||
if (SWIG_IsOK(res)) {
|
||||
if ((csize == size + 1) && cptr && !(cptr[csize-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) %delete_array(cptr);
|
||||
return SWIG_OK;
|
||||
if (alloc == SWIG_NEWOBJ) {
|
||||
%delete_array(cptr);
|
||||
res = SWIG_DelNewMask(res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
if (alloc == SWIG_NEWOBJ) %delete_array(cptr);
|
||||
}
|
||||
|
|
@ -542,7 +548,7 @@ SWIG_AsVal_dec(Char)(SWIG_Object obj, Char *val)
|
|||
int res = SWIG_As##CharName##Array(obj, val, 1);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
long v;
|
||||
res = SWIG_AsVal(long)(obj, &v);
|
||||
res = SWIG_AddCast(SWIG_AsVal(long)(obj, &v));
|
||||
if (SWIG_IsOK(res)) {
|
||||
if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
|
||||
if (val) *val = %numeric_cast(v, Char);
|
||||
|
|
|
|||
|
|
@ -3,42 +3,91 @@
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/* Pointers and arrays */
|
||||
%typemap(in, noblock=1) SWIGTYPE * (void *argp), SWIGTYPE [] (void *argp) {
|
||||
if (SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags) != SWIG_OK) {
|
||||
%typemap(in, noblock=1) SWIGTYPE *(void *argp = 0) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
$1 = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
%typemap(freearg) SWIGTYPE *, SWIGTYPE [] "";
|
||||
|
||||
%typemap(in, noblock=1) SWIGTYPE* const& (void *argp, $*ltype temp) {
|
||||
if (SWIG_ConvertPtr($input, &argp, $*descriptor, $disown | %convertptr_flags) != SWIG_OK) {
|
||||
%typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
$1 = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
|
||||
|
||||
%typemap(in, noblock=1) SWIGTYPE* const& (void *argp = 0, $*ltype temp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $*descriptor, $disown | %convertptr_flags))) {
|
||||
%argument_fail(SWIG_TypeError, "$*ltype", $argnum);
|
||||
}
|
||||
temp = %reinterpret_cast(argp, $*ltype);
|
||||
$1 = &temp;
|
||||
}
|
||||
%typemap(freearg) SWIGTYPE* const& "";
|
||||
|
||||
|
||||
/* Reference */
|
||||
%typemap(in, noblock=1) SWIGTYPE & (void *argp) {
|
||||
if (SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags) != SWIG_OK) {
|
||||
%typemap(in, noblock=1) SWIGTYPE & (void *argp = 0) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
if (!argp) { %argument_nullref("$type", $argnum); }
|
||||
$1 = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
%typemap(freearg) SWIGTYPE& "";
|
||||
#if defined(__cplusplus) && defined(%implicitconv_flag)
|
||||
%typemap(in, noblock=1,implicitconv=1) const SWIGTYPE & (void *argp = 0, int res) {
|
||||
res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags | %implicitconv_flag);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
if (!argp) { %argument_nullref("$type", $argnum); }
|
||||
$1 = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
%typemap(freearg,noblock=1,match="in") const SWIGTYPE &
|
||||
{
|
||||
if (SWIG_IsNewObj(res$argnum)) %delete($1);
|
||||
}
|
||||
#else
|
||||
%typemap(in, noblock=1) const SWIGTYPE & (void *argp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
if (!argp) { %argument_nullref("$type", $argnum); }
|
||||
$1 = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* By value */
|
||||
%typemap(in,noblock=1) SWIGTYPE (void *argp) {
|
||||
if (SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags) != SWIG_OK) {
|
||||
#if defined(__cplusplus) && defined(%implicitconv_flag)
|
||||
%typemap(in,implicitconv=1) SWIGTYPE {
|
||||
void *argp;
|
||||
int res = SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags | %implicitconv_flag);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
if (!argp) { %argument_nullref("$type", $argnum); }
|
||||
$1 = *(%reinterpret_cast(argp, $<ype));
|
||||
if (!argp) {
|
||||
%argument_nullref("$type", $argnum);
|
||||
} else {
|
||||
$<ype temp = %reinterpret_cast(argp, $<ype);
|
||||
$1 = *temp;
|
||||
if (SWIG_IsNewObj(res)) %delete(temp);
|
||||
}
|
||||
}
|
||||
%typemap(freearg) SWIGTYPE "";
|
||||
#else
|
||||
%typemap(in) SWIGTYPE {
|
||||
void *argp;
|
||||
$<ype temp;
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
if (!argp) {
|
||||
%argument_nullref("$type", $argnum);
|
||||
} else {
|
||||
$1 = *(%reinterpret_cast(argp, $<ype));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* --- Output arguments ---
|
||||
|
|
@ -88,7 +137,8 @@
|
|||
|
||||
%typemap(varin,noblock=1) SWIGTYPE [ANY] {
|
||||
$basetype *inp = 0;
|
||||
if (SWIG_ConvertPtr($input, %as_voidptrptr(&inp), $descriptor, %convertptr_flags) != SWIG_OK) {
|
||||
int res = SWIG_ConvertPtr($input, %as_voidptrptr(&inp), $descriptor, %convertptr_flags);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
} else if (inp) {
|
||||
size_t ii = 0;
|
||||
|
|
@ -143,7 +193,8 @@
|
|||
|
||||
%typemap(varin,noblock=1) SWIGTYPE [ANY][ANY] {
|
||||
$basetype (*inp)[$dim1] = 0;
|
||||
if (SWIG_ConvertPtr($input, %as_voidptrptr(&inp), $descriptor, %convertptr_flags) != SWIG_OK) {
|
||||
int res = SWIG_ConvertPtr($input, %as_voidptrptr(&inp), $descriptor, %convertptr_flags);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
} else if (inp) {
|
||||
$basetype (*dest)[$dim1] = %static_cast($1, $basetype (*)[$dim1]);
|
||||
|
|
@ -165,12 +216,13 @@
|
|||
|
||||
/* Pointers, references, and variable size arrays */
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE * {
|
||||
void *temp = 0;
|
||||
if (SWIG_ConvertPtr($input, &temp, $descriptor, %convertptr_flags) != SWIG_OK) {
|
||||
%typemap(varin,noblock=1,warning=SWIG_WARN_TYPEMAP_SWIGTYPELEAK) SWIGTYPE * {
|
||||
void *argp = 0;
|
||||
int res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
$1 = ($ltype) temp;
|
||||
$1 = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
|
||||
%typemap(varin,noblock=1,warning="462:Unable to set dimensionless array variable") SWIGTYPE []
|
||||
|
|
@ -178,27 +230,47 @@
|
|||
%variable_fail(SWIG_AttributeError, "$type", "read-only $name");
|
||||
}
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE & {
|
||||
void *temp = 0;
|
||||
if (SWIG_ConvertPtr($input, &temp, $descriptor, %convertptr_flags) != SWIG_OK) {
|
||||
%typemap(varin,noblock=1,warning=SWIG_WARN_TYPEMAP_SWIGTYPELEAK) SWIGTYPE & {
|
||||
void *argp = 0;
|
||||
int res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
if (!temp) {
|
||||
if (!argp) {
|
||||
%variable_nullref("$type", "$name");
|
||||
}
|
||||
$1 = *(%reinterpret_cast(temp, $ltype));
|
||||
$1 = *(%reinterpret_cast(argp, $ltype));
|
||||
}
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE {
|
||||
void *temp = 0;
|
||||
if (SWIG_ConvertPtr($input, &temp, $&descriptor, %convertptr_flags) != SWIG_OK) {
|
||||
#if defined(__cplusplus) && defined(%implicitconv_flag)
|
||||
%typemap(varin,noblock=1,implicitconv=1) SWIGTYPE {
|
||||
void *argp = 0;
|
||||
int res = SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags | %implicitconv_flag);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
if (!temp) {
|
||||
if (!argp) {
|
||||
%variable_nullref("$type", "$name");
|
||||
} else {
|
||||
$&type temp;
|
||||
temp = %reinterpret_cast(argp, $&type);
|
||||
$1 = *temp;
|
||||
if (SWIG_IsNewObj(res)) %delete(temp);
|
||||
}
|
||||
$1 = *(%reinterpret_cast(temp, $&type));
|
||||
}
|
||||
#else
|
||||
%typemap(varin,noblock=1) SWIGTYPE {
|
||||
void *argp = 0;
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
if (!argp) {
|
||||
%variable_nullref("$type", "$name");
|
||||
} else {
|
||||
$1 = *(%reinterpret_cast(argp, $&type));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* --- Variable output ---
|
||||
|
|
@ -227,27 +299,46 @@
|
|||
* --- Typechecking rules ---
|
||||
* ------------------------------------------------------------ */
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||
void *ptr = 0;
|
||||
$1 = (SWIG_ConvertPtr($input, &ptr, $descriptor, 0) == SWIG_OK);
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE * {
|
||||
void *vptr = 0;
|
||||
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE & {
|
||||
void *ptr = 0;
|
||||
$1 = (SWIG_ConvertPtr($input, &ptr, $descriptor, 0) == SWIG_OK) && (ptr != 0);
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE & {
|
||||
void *vptr = 0;
|
||||
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE {
|
||||
void *ptr = 0;
|
||||
$1 = (SWIG_ConvertPtr($input, &ptr, $&descriptor, 0) == SWIG_OK) && (ptr != 0);
|
||||
#if defined(__cplusplus) && defined(%implicitconv_flag)
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1,implicitconv=1) const SWIGTYPE & {
|
||||
int res = SWIG_ConvertPtr($input, 0, $descriptor, %implicitconv_flag);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1,implicitconv=1) SWIGTYPE {
|
||||
int res = SWIG_ConvertPtr($input, 0, $&descriptor, %implicitconv_flag);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
#else
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) const SWIGTYPE & {
|
||||
void *vptr = 0;
|
||||
int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE {
|
||||
void *vptr = 0;
|
||||
int res = SWIG_ConvertPtr($input, &vptr, $&descriptor, 0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* --- Director typemaps --- *
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#if defined(SWIG_DIRECTOR_TYPEMAPS)
|
||||
|
||||
/* directorin */
|
||||
|
|
@ -265,37 +356,48 @@
|
|||
}
|
||||
|
||||
/* directorout */
|
||||
|
||||
#if defined(__cplusplus) && defined(%implicitconv_flag)
|
||||
%typemap(directorout,noblock=1,implicitconv=1) SWIGTYPE (void * argp, int res) {
|
||||
res = SWIG_ConvertPtr($input,&argp,$&descriptor, %convertptr_flags | %implicitconv_flag);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = *(%reinterpret_cast(argp, $<ype));
|
||||
if (SWIG_IsNewObj(res)) %delete(%reinterpret_cast(argp, $<ype));
|
||||
}
|
||||
#else
|
||||
%typemap(directorout,noblock=1) SWIGTYPE (void * argp) {
|
||||
if (SWIG_ConvertPtr($input,&argp,$&descriptor, %convertptr_flags) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input,&argp,$&descriptor, %convertptr_flags))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = *(%reinterpret_cast(argp, $<ype));
|
||||
}
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE)
|
||||
SWIGTYPE *(void *argp, swig_owntype own), SWIGTYPE [](void *argp, swig_owntype own) {
|
||||
if (SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own) != SWIG_OK) {
|
||||
#endif
|
||||
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR)
|
||||
SWIGTYPE *(void *argp, swig_owntype own) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
swig_acquire_ownership_obj(%as_voidptr($result), own);
|
||||
}
|
||||
%typemap(directorfree,noblock=1) SWIGTYPE *, SWIGTYPE [] {
|
||||
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE * {
|
||||
if (director) {
|
||||
SWIG_AcquirePtr($result, director->swig_release_ownership(%as_voidptr($input)));
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE)
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR)
|
||||
SWIGTYPE &(void *argp, swig_owntype own) {
|
||||
if (SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtrAndOwn($input, &argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
if (!argp) { %dirout_nullref("$type"); }
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
swig_acquire_ownership_obj(%as_voidptr($result), own);
|
||||
}
|
||||
%typemap(directorfree,noblock=1) SWIGTYPE & {
|
||||
%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE & {
|
||||
if (director) {
|
||||
SWIG_AcquirePtr($result, director->swig_release_ownership(%as_voidptr($input)));
|
||||
}
|
||||
|
|
@ -341,18 +443,17 @@
|
|||
* ------------------------------------------------------------ */
|
||||
|
||||
%typemap(in,noblock=1) SWIGTYPE (CLASS::*) {
|
||||
if (SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($type),$descriptor) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($type),$descriptor))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
}
|
||||
%typemap(freearg) SWIGTYPE (CLASS::*) "";
|
||||
|
||||
%typemap(out,noblock=1) SWIGTYPE (CLASS::*) {
|
||||
%set_output(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($type), $descriptor));
|
||||
}
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE (CLASS::*) {
|
||||
if (SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($type), $descriptor) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($type), $descriptor))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
}
|
||||
|
|
@ -376,7 +477,7 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1) SWIGTYPE (CLASS::*) {
|
||||
if (SWIG_ConvertMember($input,%as_voidptr(&$result), sizeof($type), $descriptor) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertMember($input,%as_voidptr(&$result), sizeof($type), $descriptor))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
|
|
@ -393,15 +494,15 @@
|
|||
some providences.
|
||||
*/
|
||||
%typemap(in, noblock=1) SWIGTYPE ((*)(ANY)) {
|
||||
if (SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor))) {
|
||||
%argument_fail(SWIG_TypeError,"$type",$argnum);
|
||||
}
|
||||
}
|
||||
%typemap(freearg) SWIGTYPE ((*)(ANY)) "";
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE ((*)(ANY)) {
|
||||
void *ptr = 0;
|
||||
$1 = (SWIG_ConvertFunctionPtr($input, &ptr, $descriptor) == SWIG_OK);
|
||||
int res = SWIG_ConvertFunctionPtr($input, &ptr, $descriptor);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -410,7 +511,7 @@
|
|||
}
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE ((*)(ANY)) {
|
||||
if (SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
}
|
||||
|
|
@ -434,7 +535,7 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1) SWIGTYPE ((*)(ANY)) {
|
||||
if (SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
}
|
||||
|
|
@ -448,21 +549,19 @@
|
|||
/* VARARGS_SENTINEL typemap. Used by the %varargs directive. */
|
||||
|
||||
%typemap(in,numinputs=0) SWIGTYPE *VARARGS_SENTINEL, SWIGTYPE VARARGS_SENTINEL "";
|
||||
%typemap(freearg) SWIGTYPE *VARARGS_SENTINEL, SWIGTYPE VARARGS_SENTINEL "";
|
||||
|
||||
|
||||
/* DISOWN typemap */
|
||||
|
||||
%typemap(in, noblock=1) SWIGTYPE *DISOWN {
|
||||
if (SWIG_ConvertPtr($input, %as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, %as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags))) {
|
||||
%argument_fail(SWIG_TypeError,"$type", $argnum);
|
||||
}
|
||||
}
|
||||
%typemap(freearg) SWIGTYPE *DISOWN "";
|
||||
|
||||
%typemap(varin,noblock=1) SWIGTYPE *DISOWN {
|
||||
void *temp = 0;
|
||||
if (SWIG_ConvertPtr($input, &temp, $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &temp, $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
$1 = ($ltype) temp;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
|
||||
/*==== flags for new/convert methods ====*/
|
||||
|
||||
|
||||
#ifndef %convertptr_flags
|
||||
%define %convertptr_flags 0 %enddef
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -124,9 +124,8 @@ namespace swig {
|
|||
struct traits_asptr {
|
||||
static int asptr SWIG_AS_DECL_ARGS (SWIG_Object obj, Type **val) {
|
||||
Type *p;
|
||||
int res = (SWIG_ConvertPtr(obj, %as_voidptrptr(&p),
|
||||
type_info<Type>(), 0) == SWIG_OK) ? SWIG_OLDOBJ : 0;
|
||||
if (res && val) *val = p;
|
||||
int res = SWIG_ConvertPtr(obj, %as_voidptrptr(&p), type_info<Type>(), 0);
|
||||
if (SWIG_IsOK(res) && val) *val = p;
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
|
@ -142,15 +141,16 @@ namespace swig {
|
|||
if (val) {
|
||||
Type *p = 0;
|
||||
int res = traits_asptr<Type>::asptr SWIG_AS_CALL_ARGS(obj, &p);
|
||||
if ((res != 0) && p) {
|
||||
if (SWIG_IsOK(res) && p) {
|
||||
*val = *p;
|
||||
if (res == SWIG_NEWOBJ) %delete(p);
|
||||
return SWIG_OK;
|
||||
} else {
|
||||
return SWIG_ERROR;
|
||||
if (SWIG_IsNewObj(res)) {
|
||||
%delete(p);
|
||||
res = SWIG_DelNewMask(res);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
} else {
|
||||
return traits_asptr<Type>::asptr SWIG_AS_CALL_ARGS(obj, (Type **)(0)) ? SWIG_OK : SWIG_ERROR;
|
||||
return traits_asptr<Type>::asptr SWIG_AS_CALL_ARGS(obj, (Type **)(0));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -168,15 +168,25 @@ namespace swig {
|
|||
|
||||
template <class Type>
|
||||
struct traits_checkval {
|
||||
static bool check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) {
|
||||
return obj && SWIG_IsOK(asval SWIG_AS_CALL_ARGS(obj, (Type *)(0)));
|
||||
static int check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) {
|
||||
if (obj) {
|
||||
int res = asval SWIG_AS_CALL_ARGS(obj, (Type *)(0));
|
||||
return SWIG_CheckState(res);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <class Type>
|
||||
struct traits_checkptr {
|
||||
static bool check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) {
|
||||
return obj && asptr SWIG_AS_CALL_ARGS(obj, (Type **)(0));
|
||||
static int check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) {
|
||||
if (obj) {
|
||||
int res = asptr SWIG_AS_CALL_ARGS(obj, (Type **)(0));
|
||||
return SWIG_CheckState(res);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -189,7 +199,7 @@ namespace swig {
|
|||
};
|
||||
|
||||
template <class Type>
|
||||
inline bool check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) {
|
||||
inline int check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) {
|
||||
return traits_check<Type>::check SWIG_CHECK_CALL_ARGS(obj);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
}
|
||||
$result = %static_cast(val,$type);
|
||||
}
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const Type& {
|
||||
%typemap(directorout,noblock=1,fragment=frag,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) const Type& {
|
||||
Type val;
|
||||
int res = asval_meth($input, &val);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
|
|
@ -161,8 +161,8 @@
|
|||
|
||||
%define %value_typecheck_typemap(check,asval_meth,frag,Type...)
|
||||
%typemap(typecheck,noblock=1,precedence=check,fragment=frag) Type, const Type& {
|
||||
int res = SWIG_CastRank(asval_meth($input, NULL));
|
||||
$1 = SWIG_IsOK(res) ? res : 0;
|
||||
int res = asval_meth($input, NULL);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
/* in */
|
||||
|
||||
%typemap(in,noblock=1) void * {
|
||||
if (SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $argnum);
|
||||
}
|
||||
}
|
||||
%typemap(freearg) void * "";
|
||||
|
||||
%typemap(in,noblock=1) void * const& ($*ltype temp) {
|
||||
if (SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown))) {
|
||||
%argument_fail(SWIG_TypeError, "Stype", $argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
%typemap(varin,noblock=1) void * {
|
||||
void *temp = 0;
|
||||
if (SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
}
|
||||
$1 = ($1_ltype) temp;
|
||||
|
|
@ -43,7 +43,8 @@
|
|||
%typecheck(SWIG_TYPECHECK_VOIDPTR, noblock=1) void *
|
||||
{
|
||||
void *ptr = 0;
|
||||
$1 = (SWIG_ConvertPtr($input, &ptr, 0, 0) == SWIG_OK);
|
||||
int res = SWIG_ConvertPtr($input, &ptr, 0, 0);
|
||||
$1 = SWIG_CheckState(res);
|
||||
}
|
||||
|
||||
#if defined(SWIG_DIRECTOR_TYPEMAPS)
|
||||
|
|
@ -58,14 +59,14 @@
|
|||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1) void * (void *argp) {
|
||||
if (SWIG_ConvertPtr($input, &argp, 0, 0) != SWIG_OK) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, 0, 0))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) void * const& (void *argp) {
|
||||
if (SWIG_ConvertPtr($input, &argp, 0, $disown) != SWIG_OK) {
|
||||
%typemap(directorout,noblock=1,warning=SWIG_WARN_TYPEMAP_DIRECTOROUT_PTR) void * const& (void *argp) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr($input, &argp, 0, $disown))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
}
|
||||
static $*ltype temp = %reinterpret_cast(argp, $*ltype);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue