~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Lib/guile/guile_gh.swg

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
#define SWIGGUILE_GH
7
7
 
 
8
%runtime "swigrun.swg"
8
9
%runtime "guile_gh_run.swg"
9
10
%include "guile.i"
10
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
 
11
41
%init %{
12
 
  static int _swig_init = 0;
13
 
 
14
 
  if (!_swig_init) {
15
 
    SWIG_Guile_RegisterTypes(swig_types, swig_types_initial);
16
 
    _swig_init = 1;
17
 
  }
18
 
 
19
 
  SWIG_Guile_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);
20
52
%}