File: guile_gh.swg

package info (click to toggle)
swig1.3 1.3.40-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,512 kB
  • ctags: 14,780
  • sloc: cpp: 41,436; ansic: 31,416; python: 9,313; java: 7,332; makefile: 5,264; cs: 5,231; yacc: 4,995; sh: 4,646; ruby: 3,774; perl: 3,638; lisp: 1,993; php: 1,736; tcl: 1,266; ml: 708
file content (74 lines) | stat: -rw-r--r-- 2,255 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* -----------------------------------------------------------------------------
 * See the LICENSE file for information on copyright, usage and redistribution
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 *
 * guile_gh.swg
 *
 * 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"

#define SWIG_convert_short(o)					\
  SWIG_convert_integer(o, - (1 << (8 * sizeof(short) - 1)),	\
		       (1 << (8 * sizeof(short) - 1)) - 1,	\
		       FUNC_NAME, $argnum)
#define SWIG_convert_unsigned_short(o)			\
  SWIG_convert_unsigned_integer(o, 0,				\
		       (1 << (8 * sizeof(short))) - 1,	\
		       FUNC_NAME, $argnum)
#define SWIG_convert_unsigned_int(o)		\
  SWIG_convert_unsigned_integer(o, 0, UINT_MAX,	\
		       FUNC_NAME, $argnum)

#define gh_scm2short(a) SWIG_convert_short(a)
#define gh_scm2ushort(a) SWIG_convert_unsigned_short(a)
#define gh_scm2uint(a)   SWIG_convert_unsigned_int(a)

%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);
%}