Added member pointer typemaps.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5445 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-11-30 18:53:43 +00:00
commit d99face03c

View file

@ -60,7 +60,8 @@
"if ((SWIG_ConvertPtr($input, (void **) &argp, $&1_descriptor,SWIG_POINTER_EXCEPTION ) != TCL_OK)) SWIG_fail;
$1 = *argp; ";
/* Member pointer */
%typemap(in) SWIGTYPE (CLASS::*) "if ((SWIG_ConvertPacked($input, (void *) &$1, sizeof($1_type), $1_descriptor, SWIG_POINTER_EXCEPTION)) != TCL_OK) SWIG_fail;";
/* Special constant variations. These typemaps can be used to parse objects that are both constants
or values. A Hash table lookup will occur. */
@ -177,6 +178,9 @@
Tcl_SetObjResult(interp,SWIG_NewInstanceObj((void *) $1, ty,0));
}
%typemap(out) SWIGTYPE (CLASS::*)
"Tcl_SetObjResult(interp, SWIG_NewPackedObj((void *) &$1, sizeof($1_type), $1_descriptor, 0));";
%typemap(out) void "";
/* Primitive types--return by value */
@ -280,6 +284,7 @@
%typemap(varout) SWIGTYPE INSTANCE "$result = SWIG_NewInstanceObj((void *) &$1, $&1_descriptor,0);";
%typemap(varout) SWIGTYPE "$result = SWIG_NewInstanceObj((void *) &$1, $&1_descriptor,0);";
%typemap(varout) SWIGTYPE (CLASS::*) "$result = SWIG_NewPackedObj((void *) &$1, sizeof($1_type), $1_descriptor, 0);";
/* -- Variable input --- */
@ -394,6 +399,14 @@
}
memmove((void *) $1,temp,$1_size*sizeof($1_basetype));
}
%typemap(varin) SWIGTYPE (CLASS::*) {
char temp[sizeof($1_type)];
if (SWIG_ConvertPacked($input, temp, sizeof($1_type), $1_descriptor, SWIG_POINTER_EXCEPTION) != TCL_OK) {
return (char *) "Type error. Expected $1_ltype";
}
memmove((void *) &$1, temp, sizeof($1_type));
}
/* --- Constants --- */