1 /* ----------------------------------------------------------------------------- 2 * std_common.i 3 * 4 * SWIG typemaps for STL - common utilities 5 * ----------------------------------------------------------------------------- */ 6 7 %include <std/std_except.i> 8 9 %apply size_t { std::size_t }; 10 11 #define SWIG_bool2scm(b) scm_from_bool(b ? 1 : 0) 12 #define SWIG_string2scm(s) SWIG_str02scm(s.c_str()) 13 14 %{ 15 #include <string> 16 17 inline std::string SWIG_scm2string(SCM x) { 18 char* temp; 19 temp = SWIG_scm2str(x); 20 std::string s(temp); 21 if (temp) SWIG_free(temp); 22 return s; 23 } 24 %} 25