Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* -*- c -*- |
2 | This SWIG interface file is processed if the Guile module is run | |
3 | with gh_ flavor. | |
4 | */ | |
5 | ||
6 | #define SWIGGUILE_GH | |
7 | ||
8 | %runtime "swigrun.swg" | |
9 | %runtime "guile_gh_run.swg" | |
10 | %include "guile.i" | |
11 | ||
12 | %runtime %{ | |
13 | ||
14 | /* scm_values was implemented on C level in 1.4.1, and the prototype | |
15 | is not included in libguile.h, so play safe and lookup `values'... */ | |
16 | #define GUILE_MAYBE_VALUES \ | |
17 | if (gswig_list_p) \ | |
18 | gswig_result = gh_apply(gh_lookup("values"), gswig_result); | |
19 | ||
20 | #define GUILE_MAYBE_VECTOR \ | |
21 | if (gswig_list_p) \ | |
22 | gswig_result = gh_list_to_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 = gh_list(gswig_result, object, SCM_UNDEFINED); \ | |
31 | } \ | |
32 | else \ | |
33 | gswig_result = gh_append2(gswig_result, \ | |
34 | gh_list(object, SCM_UNDEFINED)); \ | |
35 | } | |
36 | ||
37 | %} | |
38 | ||
39 | %init "swiginit.swg" | |
40 | ||
41 | %init %{ | |
42 | static int _swig_module_smob_tag; | |
43 | ||
44 | SWIG_GUILE_INIT_STATIC void | |
45 | SWIG_init(void) | |
46 | { | |
47 | ||
48 | SWIG_InitializeModule(0); | |
49 | swig_module.clientdata = (void *) &_swig_module_smob_tag; | |
50 | ||
51 | SWIG_Guile_Init(&swig_module); | |
52 | %} |