Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | // |
2 | // SWIG typemaps for STL - common utilities | |
3 | // Luigi Ballabio | |
4 | // Aug 3, 2002 | |
5 | // | |
6 | // Guile implementation | |
7 | ||
8 | %include <std/std_except.i> | |
9 | ||
10 | %apply size_t { std::size_t }; | |
11 | ||
12 | #define SWIG_bool2scm(b) gh_bool2scm(b ? 1 : 0) | |
13 | #define SWIG_string2scm(s) gh_str02scm(s.c_str()) | |
14 | ||
15 | %{ | |
16 | #include <string> | |
17 | ||
18 | inline std::string SWIG_scm2string(SCM x) { | |
19 | char* temp; | |
20 | temp = SWIG_scm2str(x); | |
21 | std::string s(temp); | |
22 | if (temp) SWIG_free(temp); | |
23 | return s; | |
24 | } | |
25 | %} |