3/6/2006: mutandiz

[allegrocl]
	add Lib/allegrocl/inout_typemaps.i


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8970 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Mikel Bancroft 2006-03-06 18:47:07 +00:00
commit cce4f05784

53
Lib/allegrocl/inout_typemaps.i Executable file
View file

@ -0,0 +1,53 @@
/* inout_typemaps.i
Support for INPUT, OUTPUT, and INOUT typemaps. OUTPUT variables are returned
as multiple values.
*/
%define INOUT_TYPEMAP(type_)
// OUTPUT map.
%typemap(lin,numinputs=0) type_ *OUTPUT
%{
(let (($out (ff:allocate-fobject '$*in_fftype :c)))
$body
(push (ff:fslot-value-typed '$*in_fftype :c $out) ACL_result)
(ff:free-fobject $out))
%}
// INPUT map.
%typemap(in) type_ *INPUT, type_ &INPUT
%{ $1 = &$input; %}
%typemap(ctype) type_ *INPUT, type_ &INPUT "$*1_ltype";
// INOUT map.
%typemap(lin,numinputs=1) type_ *INOUT, type_ &INOUT
%{
(let (($out (ff:allocate-fobject '$*in_fftype :c)))
(setf (ff:fslot-value-typed '$*in_fftype :c $out) $in)
$body
(push (ff:fslot-value-typed $*in_fftype :c $out) ACL_result)
(ff:free-fobject $out))
%}
%enddef
// $in, $out, $lclass,
// $in_fftype, $*in_fftype
INOUT_TYPEMAP(int);
INOUT_TYPEMAP(short);
INOUT_TYPEMAP(long);
INOUT_TYPEMAP(unsigned int);
INOUT_TYPEMAP(unsigned short);
INOUT_TYPEMAP(unsigned long);
INOUT_TYPEMAP(char);
INOUT_TYPEMAP(bool);
INOUT_TYPEMAP(float);
INOUT_TYPEMAP(double);
// long long support not yet complete
// INOUT_TYPEMAP(long long);
// INOUT_TYPEMAP(unsigned long long);