swig/SWIG/Lib/guile/guile_gh.swg
William S Fulton e013e7ff5a Use the system angle brackets for %include
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7871 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-26 09:28:20 +00:00

52 lines
1.3 KiB
C

/* -*- c -*-
This SWIG interface file is processed if the Guile module is run
with gh_ flavor.
*/
#define SWIGGUILE_GH
%runtime "swigrun.swg"
%runtime "guile_gh_run.swg"
%include <guile.i>
%runtime %{
/* scm_values was implemented on C level in 1.4.1, and the prototype
is not included in libguile.h, so play safe and lookup `values'... */
#define GUILE_MAYBE_VALUES \
if (gswig_list_p) \
gswig_result = gh_apply(gh_lookup("values"), gswig_result);
#define GUILE_MAYBE_VECTOR \
if (gswig_list_p) \
gswig_result = gh_list_to_vector(gswig_result);
#define SWIG_APPEND_VALUE(object) \
if (gswig_result == SCM_UNSPECIFIED) { \
gswig_result = object; \
} else { \
if (!gswig_list_p) { \
gswig_list_p = 1; \
gswig_result = gh_list(gswig_result, object, SCM_UNDEFINED); \
} \
else \
gswig_result = gh_append2(gswig_result, \
gh_list(object, SCM_UNDEFINED)); \
}
%}
%init "swiginit.swg"
%init %{
static int _swig_module_smob_tag;
SWIG_GUILE_INIT_STATIC void
SWIG_init(void)
{
SWIG_InitializeModule(0);
swig_module.clientdata = (void *) &_swig_module_smob_tag;
SWIG_Guile_Init(&swig_module);
%}