79
78
$result = to_scheme (convtype ($varname));
81
%typemap(throws) type_
83
SWIG_Chicken_ThrowException(to_scheme ( convtype ($1)));
84
88
%typemap(out) type_
86
91
C_word *space = C_alloc(storage_);
87
92
$result = to_scheme (&space, convtype ($1));
90
96
/* References to primitive types. Return by value */
92
98
%typemap(out) const type_ &
94
$result = to_scheme (convtype (*$1));
101
C_word *space = C_alloc(storage_);
102
$result = to_scheme (&space, convtype (*$1));
97
106
/* --- Variable output --- */
98
107
%typemap(varout) type_
100
110
C_word *space = C_alloc(storage_);
101
111
$result = to_scheme (&space, convtype ($varname));
115
%typemap(throws) type_
118
C_word *space = C_alloc(storage_);
119
SWIG_Chicken_ThrowException(to_scheme (&space, convtype ($1)));
106
125
/* --- Constants --- */
108
#if ("type_" == "char") || ("type_" == "unsigned char") || ("type_" == "signed char")
109
%typemap(constcode) type_
110
"static const $1_type $result = '$value';"
112
127
%typemap(constcode) type_
113
128
"static const $1_type $result = $value;"
118
SIMPLE_TYPEMAP(int, C_unfix, C_fix, C_swig_is_fixnum, (int), 0);
119
SIMPLE_TYPEMAP(enum SWIGTYPE, C_unfix, C_fix, C_swig_is_fixnum, (int), 0);
120
SIMPLE_TYPEMAP(short, C_unfix, C_fix, C_swig_is_fixnum, (int), 0);
121
SIMPLE_TYPEMAP(long, C_flonum_magnitude, C_flonum, C_swig_is_flonum, (double), C_SIZEOF_FLONUM);
122
SIMPLE_TYPEMAP(long long, C_flonum_magnitude, C_flonum, C_swig_is_flonum, (double), C_SIZEOF_FLONUM);
123
SIMPLE_TYPEMAP(unsigned int, C_unfix, C_fix, C_swig_is_fixnum, (int), 0);
124
SIMPLE_TYPEMAP(unsigned short, C_unfix, C_fix, C_swig_is_fixnum, (int), 0);
125
SIMPLE_TYPEMAP(unsigned long, C_flonum_magnitude, C_flonum, C_swig_is_flonum, (double), C_SIZEOF_FLONUM);
126
SIMPLE_TYPEMAP(unsigned long long, C_flonum_magnitude, C_flonum, C_swig_is_flonum, (double), C_SIZEOF_FLONUM);
127
SIMPLE_TYPEMAP(unsigned char, C_unfix, C_fix, C_swig_is_fixnum, (int), 0);
128
SIMPLE_TYPEMAP(signed char, C_unfix, C_fix, C_swig_is_fixnum, (int), 0);
132
SIMPLE_TYPEMAP(int, C_num_to_int, C_fix, C_swig_is_number, (int), 0);
133
//SIMPLE_TYPEMAP(enum SWIGTYPE, C_unfix, C_fix, C_swig_is_fixnum, (int), 0);
134
SIMPLE_TYPEMAP(short, C_num_to_int, C_fix, C_swig_is_number, (int), 0);
135
SIMPLE_TYPEMAP(long, C_num_to_long, C_long_to_num, C_swig_is_long, (long), C_SIZEOF_FLONUM);
136
SIMPLE_TYPEMAP(long long, C_num_to_long, C_long_to_num, C_swig_is_long, (long), C_SIZEOF_FLONUM);
137
SIMPLE_TYPEMAP(unsigned int, C_num_to_unsigned_int, C_fix, C_swig_is_number, (int), 0);
138
SIMPLE_TYPEMAP(unsigned short, C_num_to_unsigned_int, C_fix, C_swig_is_number, (int), 0);
139
SIMPLE_TYPEMAP(unsigned long, C_num_to_long, C_long_to_num, C_swig_is_long, (long), C_SIZEOF_FLONUM);
140
SIMPLE_TYPEMAP(unsigned long long, C_num_to_long, C_long_to_num, C_swig_is_long, (long), C_SIZEOF_FLONUM);
141
SIMPLE_TYPEMAP(unsigned char, C_character_code, C_make_character, C_swig_is_char, (unsigned int), 0);
142
SIMPLE_TYPEMAP(signed char, C_character_code, C_make_character, C_swig_is_char, (int), 0);
129
143
SIMPLE_TYPEMAP(char, C_character_code, C_make_character, C_swig_is_char, (char), 0);
130
144
SIMPLE_TYPEMAP(bool, C_truep, C_mk_bool, C_swig_is_bool, (bool), 0);
131
SIMPLE_TYPEMAP(float, C_flonum_magnitude, C_flonum, C_swig_is_flonum, (double), C_SIZEOF_FLONUM);
132
SIMPLE_TYPEMAP(double, C_flonum_magnitude, C_flonum, C_swig_is_flonum, (double), C_SIZEOF_FLONUM);
145
SIMPLE_TYPEMAP(float, C_c_double, C_flonum, C_swig_is_number, (double), C_SIZEOF_FLONUM);
146
SIMPLE_TYPEMAP(double, C_c_double, C_flonum, C_swig_is_number, (double), C_SIZEOF_FLONUM);
149
%apply int { enum SWIGTYPE };
150
%apply const int& { const enum SWIGTYPE& };
152
%typemap(varin) enum SWIGTYPE
154
if (!C_swig_is_fixnum($input) && sizeof(int) != sizeof($1)) {
155
swig_barf(SWIG_BARF1_BAD_ARGUMENT_TYPE, "enum variable '$name' can not be set");
157
*((int *)(void *)&$1) = C_unfix($input);
134
161
/* --- Input arguments --- */
184
215
$1 = SWIG_MustGetPtr($input, NULL, 1, 0);
187
%typemap(out) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
218
%typemap(out,chickenfastproxy="1") SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
188
219
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
189
$result = SWIG_NewPointerObj ($1, $descriptor, $owner);
220
$result = SWIG_NewPointerObjProxy($1, $descriptor, $owner, $proxy);
192
%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC {
223
%typemap(out,chickenfastproxy="1") SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC {
193
224
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
194
225
swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1);
195
$result = SWIG_NewPointerObj ($1, ty, $owner);
226
$result = SWIG_NewPointerObjProxy($1, ty, $owner, $proxy);
198
%typemap(varout) SWIGTYPE *, SWIGTYPE [] {
229
%typemap(varout,chickenfastproxy="1") SWIGTYPE *, SWIGTYPE [] {
199
230
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
200
$result = SWIG_NewPointerObj ($varname, $descriptor, 0);
231
$result = SWIG_NewPointerObjProxy($varname, $descriptor, 0, 0);
203
%typemap(varout) SWIGTYPE & {
234
%typemap(varout,chickenfastproxy="1") SWIGTYPE & {
204
235
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
205
$result = SWIG_NewPointerObj((void *) &$varname, $1_descriptor, 0);
236
$result = SWIG_NewPointerObjProxy((void *) &$varname, $1_descriptor, 0, 0);
208
239
/* Pass-by-value */
210
%typemap(in) SWIGTYPE($&1_ltype argp) {
241
%typemap(in,closcode="(slot-ref $input 'swig-this)") SWIGTYPE($&1_ltype argp) {
211
242
argp = ($&1_ltype)SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0);
506
546
$1 = !SWIG_ConvertPtr($input, &ptr, 0, 0);
549
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE &
552
if (SWIG_ConvertPtr($input, &ptr, $descriptor, 0)) {
560
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE
563
if (SWIG_ConvertPtr($input, &ptr, $&descriptor, 0)) {
509
572
/* ------------------------------------------------------------
510
573
* Exception handling
511
574
* ------------------------------------------------------------ */
576
/* ------------------------------------------------------------
577
* --- Exception handling ---
578
* ------------------------------------------------------------ */
580
%typemap(throws) SWIGTYPE {
581
$<ype temp = new $ltype($1);
582
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
583
C_word ptr = SWIG_NewPointerObj(temp, $&descriptor,1);
584
SWIG_Chicken_ThrowException(ptr);
587
%typemap(throws) SWIGTYPE * {
588
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
589
C_word ptr = SWIG_NewPointerObj((void *) $1, $descriptor, 0);
590
SWIG_Chicken_ThrowException(ptr);
593
%typemap(throws) SWIGTYPE [ANY] {
594
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
595
C_word ptr = SWIG_NewPointerObj((void *) $1, $descriptor, 0);
596
SWIG_Chicken_ThrowException(ptr);
599
%typemap(throws) SWIGTYPE & {
600
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
601
C_word ptr = SWIG_NewPointerObj((void *)&($1),$descriptor,0);
602
SWIG_Chicken_ThrowException(ptr);
605
/* ------------------------------------------------------------
607
* ------------------------------------------------------------ */
609
%apply unsigned long { size_t };
515
611
/* ------------------------------------------------------------
516
612
* Overloaded operator support
597
695
C_word *return_vec;
600
/* lookup the type pointer... it is stored in it's own symbol table */
601
C_SYMBOL_TABLE *stable = C_find_symbol_table("swig_runtime_data" SWIG_RUNTIME_VERSION);
602
if (stable != NULL) {
603
sym = SWIG_Chicken_LookupSymbol(swig_type_ptr_name, stable);
604
if (C_truep(sym) && C_swig_is_ptr(sym)) {
605
swig_type_list_handle = (swig_type_info **) C_block_item(sym, 0);
608
C_word *a = C_alloc(C_SIZEOF_POINTER + C_SIZEOF_INTERNED_SYMBOL(C_strlen(swig_type_ptr_name)));
609
stable = C_new_symbol_table("swig_runtime_data" SWIG_RUNTIME_VERSION, 16);
610
sym = C_intern_in(&a, C_strlen(swig_type_ptr_name), swig_type_ptr_name, stable);
611
C_mutate(&C_block_item(sym, 0), C_mpointer(&a, (void *) swig_type_list_handle));
614
for (i = 0; swig_types_initial[i]; i++) {
615
swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
617
for (i = 0; swig_types_initial[i]; i++) {
618
SWIG_PropagateClientData(swig_types[i]);
623
ret = C_SCHEME_FALSE;
697
SWIG_InitializeModule(0);
698
SWIG_PropagateClientData();
627
702
return_vec = C_alloc(C_SIZEOF_VECTOR($veclength));