/tags/rel-1-3-26/SWIG/Lib/guile/std_common.i
# · Swig · 25 lines · 20 code · 5 blank · 0 comment · 0 complexity · fa27d49cef1b0c8b58ec30faa35be265 MD5 · raw file
- //
- // SWIG typemaps for STL - common utilities
- // Luigi Ballabio
- // Aug 3, 2002
- //
- // Guile implementation
- %include <std/std_except.i>
- %apply size_t { std::size_t };
- #define SWIG_bool2scm(b) gh_bool2scm(b ? 1 : 0)
- #define SWIG_string2scm(s) gh_str02scm(s.c_str())
- %{
- #include <string>
- inline std::string SWIG_scm2string(SCM x) {
- char* temp;
- temp = SWIG_scm2str(x);
- std::string s(temp);
- if (temp) SWIG_free(temp);
- return s;
- }
- %}