PageRenderTime 23ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Lib/guile/guile_scm.swg

#
Unknown | 50 lines | 40 code | 10 blank | 0 comment | 0 complexity | 63c72f812a2969aa3098a83379425d1e MD5 | raw file
 1/* -----------------------------------------------------------------------------
 2 * guile_scm.swg
 3 *
 4 * This SWIG interface file is processed if the Guile module is run
 5 * with SCM_ flavor.
 6 * ----------------------------------------------------------------------------- */
 7
 8#define SWIGGUILE_SCM
 9
10%runtime "swigrun.swg"       // Common C API type-checking code
11
12%runtime "guile_scm_run.swg"
13%include <ghinterface.i>
14%include <guile.i>
15
16%runtime %{
17
18#define GUILE_MAYBE_VALUES \
19      if (gswig_list_p) gswig_result = scm_values(gswig_result);
20
21#define GUILE_MAYBE_VECTOR \
22      if (gswig_list_p) gswig_result = scm_vector(gswig_result);
23
24#define SWIG_APPEND_VALUE(object)						\
25    if (gswig_result == SCM_UNSPECIFIED)						\
26        gswig_result = object;							\
27    else {									\
28      if (!gswig_list_p) {							\
29	      gswig_list_p = 1;							\
30	      gswig_result = scm_listify(gswig_result, object, SCM_UNDEFINED);	\
31      }									\
32      else									\
33            gswig_result = scm_append(scm_listify(gswig_result, scm_listify(object, SCM_UNDEFINED), SCM_UNDEFINED));		\
34    }
35    /* used by Lib/exception.i */
36    #define gh_symbol2scm scm_str2symbol
37    /* useb by Lib/cdata.i */
38    #define gh_str2scm scm_mem2string
39
40%}
41
42%insert(init) "swiginit.swg"
43
44%init %{
45SWIG_GUILE_INIT_STATIC void
46SWIG_init(void)
47{
48  SWIG_InitializeModule(0);
49  SWIG_PropagateClientData();
50%}