1 /* ----------------------------------------------------------------------------- 2 * cplusplus.i 3 * 4 * SWIG typemaps for C++ 5 * ----------------------------------------------------------------------------- */ 6 7 %typemap(guile,out) string, std::string { 8 $result = SWIG_str02scm(const_cast<char*>($1.c_str())); 9 } 10 %typemap(guile,in) string, std::string { 11 $1 = SWIG_scm2str($input); 12 } 13 14 %typemap(guile,out) complex, complex<double>, std::complex<double> { 15 $result = scm_make_rectangular( scm_from_double ($1.real ()), 16 scm_from_double ($1.imag ()) ); 17 } 18 %typemap(guile,in) complex, complex<double>, std::complex<double> { 19 $1 = std::complex<double>( scm_to_double (scm_real_part ($input)), 20 scm_to_double (scm_imag_part ($input)) ); 21 } 22 23