From: Mikel B. <mut...@us...> - 2006-03-12 20:39:06
|
Update of /cvsroot/swig/SWIG/Lib/allegrocl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24073/Lib/allegrocl Modified Files: inout_typemaps.i Log Message: 03/12/2006: mutandiz [allegrocl] Add INPUT/OUTPUT typemaps for bool. Generate c++ style wrappers for struct/unions when -cwrap option specified. Index: inout_typemaps.i =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/allegrocl/inout_typemaps.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** inout_typemaps.i 9 Mar 2006 08:37:12 -0000 1.2 --- inout_typemaps.i 12 Mar 2006 20:38:57 -0000 1.3 *************** *** 7,19 **** ! %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. --- 7,17 ---- ! %define INOUT_TYPEMAP(type_, OUTresult_, INbind_) // OUTPUT map. ! %typemap(lin,numinputs=0) type_ *OUTPUT, type_ &OUTPUT ! %{(let (($out (ff:allocate-fobject '$*in_fftype :c))) $body ! OUTresult_ ! (ff:free-fobject $out)) %} // INPUT map. *************** *** 26,36 **** // 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 --- 24,32 ---- // INOUT map. %typemap(lin,numinputs=1) type_ *INOUT, type_ &INOUT ! %{(let (($out (ff:allocate-fobject '$*in_fftype :c))) ! INbind_ $body ! OUTresult_ ! (ff:free-fobject $out)) %} %enddef *************** *** 39,52 **** // $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); --- 35,70 ---- // $in_fftype, $*in_fftype ! INOUT_TYPEMAP(int, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(short, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(long, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(unsigned int, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(unsigned short, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(unsigned long, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(char, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(float, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(double, ! (push (ff:fslot-value-typed (quote $*in_fftype) :c $out) ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) $in)); ! INOUT_TYPEMAP(bool, ! (push (not (zerop (ff:fslot-value-typed (quote $*in_fftype) :c $out))) ! ACL_result), ! (setf (ff:fslot-value-typed (quote $*in_fftype) :c $out) (if $in 1 0))); ! // long long support not yet complete // INOUT_TYPEMAP(long long); |