PageRenderTime 40ms CodeModel.GetById 37ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Lib/guile/std_common.i

#
Swig | 24 lines | 14 code | 5 blank | 5 comment | 0 complexity | 175e992d52bccb21d22995c3fc845e9f MD5 | raw file
 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) gh_bool2scm(b ? 1 : 0)
12#define SWIG_string2scm(s) gh_str02scm(s.c_str())
13
14%{
15#include <string>
16
17inline 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%}