From: Marcelo M. <mar...@us...> - 2004-11-15 20:55:29
|
Update of /cvsroot/swig/SWIG/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25541 Modified Files: swig.swg Log Message: add typemaps for vars +two dimensional arrays Index: swig.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/swig.swg,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** swig.swg 4 Nov 2004 22:26:17 -0000 1.37 --- swig.swg 15 Nov 2004 20:55:20 -0000 1.38 *************** *** 192,196 **** } ! /* memberin typemap for arrays. */ %typemap(memberin) SWIGTYPE [ANY] { --- 192,196 ---- } ! /* memberin/globalin typemap for arrays. */ %typemap(memberin) SWIGTYPE [ANY] { *************** *** 206,209 **** --- 206,235 ---- } + /* memberin/globalin typemap for double arrays. */ + + %typemap(memberin) SWIGTYPE [ANY][ANY] { + $basetype (*inp)[$dim1] = ($basetype (*)[$dim1])($input); + $basetype (*dest)[$dim1] = ($basetype (*)[$dim1])($1); + size_t ii = 0; + for (; ii < $dim0; ++ii) { + $basetype *ip = inp[ii]; + $basetype *dp = dest[ii]; + size_t jj = 0; + for (; jj < $dim1; ++jj) dp[jj] = ip[jj]; + } + } + + %typemap(globalin) SWIGTYPE [ANY][ANY] { + $basetype (*inp)[$dim1] = ($basetype (*)[$dim1])($input); + $basetype (*dest)[$dim1] = ($basetype (*)[$dim1])($1); + size_t ii = 0; + for (; ii < $dim0; ++ii) { + $basetype *ip = inp[ii]; + $basetype *dp = dest[ii]; + size_t jj = 0; + for (; jj < $dim1; ++jj) dp[jj] = ip[jj]; + } + } + /* Typemap for variable length arguments sentinel value. Used by the %varargs directive. */ |