3/6/2006: mutandiz
[allegrocl] add Lib/allegrocl/inout_typemaps.i git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8970 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9371153164
commit
abad54d343
1 changed files with 53 additions and 0 deletions
53
SWIG/Lib/allegrocl/inout_typemaps.i
Executable file
53
SWIG/Lib/allegrocl/inout_typemaps.i
Executable 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);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue