PageRenderTime 12ms CodeModel.GetById 11ms app.highlight 0ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 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
18inline 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%}