Line
Link Here
|
0 |
-- Examples/test-suite/guile/guile_ext_test_external.cxx |
0 |
++ Examples/test-suite/guile/guile_ext_test_external.cxx |
Lines 19-24
Link Here
|
19 |
SCM test_is_pointer(SCM val) |
19 |
SCM test_is_pointer(SCM val) |
20 |
{ |
20 |
{ |
21 |
#define FUNC_NAME "test-is-pointer" |
21 |
#define FUNC_NAME "test-is-pointer" |
22 |
return SCM_BOOL(SWIG_IsPointer(val)); |
22 |
return scm_from_bool(SWIG_IsPointer(val)); |
23 |
#undef FUNC_NAME |
23 |
#undef FUNC_NAME |
24 |
} |
24 |
} |
25 |
-- Lib/guile/guile_scm_run.swg |
25 |
++ Lib/guile/guile_scm_run.swg |
Lines 124-130
Link Here
|
124 |
else |
124 |
else |
125 |
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); |
125 |
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); |
126 |
|
126 |
|
127 |
if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) { |
127 |
if (!cdata || scm_is_null(cdata->goops_class) || swig_make_func == SCM_EOL ) { |
128 |
return smob; |
128 |
return smob; |
129 |
} else { |
129 |
} else { |
130 |
/* the scm_make() C function only handles the creation of gf, |
130 |
/* the scm_make() C function only handles the creation of gf, |
Lines 144-150
Link Here
|
144 |
SWIG_Guile_PointerAddress(SCM object) |
144 |
SWIG_Guile_PointerAddress(SCM object) |
145 |
{ |
145 |
{ |
146 |
SCM smob = SWIG_Guile_GetSmob(object); |
146 |
SCM smob = SWIG_Guile_GetSmob(object); |
147 |
if (SCM_NULLP(smob)) return 0; |
147 |
if (scm_is_null(smob)) return 0; |
148 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
148 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
149 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
149 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
150 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
150 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
Lines 157-163
Link Here
|
157 |
SWIG_Guile_PointerType(SCM object) |
157 |
SWIG_Guile_PointerType(SCM object) |
158 |
{ |
158 |
{ |
159 |
SCM smob = SWIG_Guile_GetSmob(object); |
159 |
SCM smob = SWIG_Guile_GetSmob(object); |
160 |
if (SCM_NULLP(smob)) return NULL; |
160 |
if (scm_is_null(smob)) return NULL; |
161 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
161 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
162 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
162 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
163 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
163 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
Lines 173-179
Link Here
|
173 |
swig_type_info *from; |
173 |
swig_type_info *from; |
174 |
SCM smob = SWIG_Guile_GetSmob(s); |
174 |
SCM smob = SWIG_Guile_GetSmob(s); |
175 |
|
175 |
|
176 |
if (SCM_NULLP(smob)) { |
176 |
if (scm_is_null(smob)) { |
177 |
*result = NULL; |
177 |
*result = NULL; |
178 |
return SWIG_OK; |
178 |
return SWIG_OK; |
179 |
} else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
179 |
} else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
Lines 235-241
Link Here
|
235 |
SWIG_Guile_MarkPointerNoncollectable(SCM s) |
235 |
SWIG_Guile_MarkPointerNoncollectable(SCM s) |
236 |
{ |
236 |
{ |
237 |
SCM smob = SWIG_Guile_GetSmob(s); |
237 |
SCM smob = SWIG_Guile_GetSmob(s); |
238 |
if (!SCM_NULLP(smob)) { |
238 |
if (!scm_is_null(smob)) { |
239 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
239 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
240 |
SCM_SET_CELL_TYPE(smob, swig_tag); |
240 |
SCM_SET_CELL_TYPE(smob, swig_tag); |
241 |
} |
241 |
} |
Lines 248-254
Link Here
|
248 |
SWIG_Guile_MarkPointerDestroyed(SCM s) |
248 |
SWIG_Guile_MarkPointerDestroyed(SCM s) |
249 |
{ |
249 |
{ |
250 |
SCM smob = SWIG_Guile_GetSmob(s); |
250 |
SCM smob = SWIG_Guile_GetSmob(s); |
251 |
if (!SCM_NULLP(smob)) { |
251 |
if (!scm_is_null(smob)) { |
252 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
252 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
253 |
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); |
253 |
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); |
254 |
} |
254 |
} |
Lines 467-486
Link Here
|
467 |
int i; |
467 |
int i; |
468 |
int num_args_passed = 0; |
468 |
int num_args_passed = 0; |
469 |
for (i = 0; i<reqargs; i++) { |
469 |
for (i = 0; i<reqargs; i++) { |
470 |
if (!SCM_CONSP(rest)) |
470 |
if (!scm_is_pair(rest)) |
471 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
471 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
472 |
*dest++ = SCM_CAR(rest); |
472 |
*dest++ = SCM_CAR(rest); |
473 |
rest = SCM_CDR(rest); |
473 |
rest = SCM_CDR(rest); |
474 |
num_args_passed++; |
474 |
num_args_passed++; |
475 |
} |
475 |
} |
476 |
for (i = 0; i<optargs && SCM_CONSP(rest); i++) { |
476 |
for (i = 0; i<optargs && scm_is_pair(rest); i++) { |
477 |
*dest++ = SCM_CAR(rest); |
477 |
*dest++ = SCM_CAR(rest); |
478 |
rest = SCM_CDR(rest); |
478 |
rest = SCM_CDR(rest); |
479 |
num_args_passed++; |
479 |
num_args_passed++; |
480 |
} |
480 |
} |
481 |
for (; i<optargs; i++) |
481 |
for (; i<optargs; i++) |
482 |
*dest++ = SCM_UNDEFINED; |
482 |
*dest++ = SCM_UNDEFINED; |
483 |
if (!SCM_NULLP(rest)) |
483 |
if (!scm_is_null(rest)) |
484 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
484 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
485 |
return num_args_passed; |
485 |
return num_args_passed; |
486 |
} |
486 |
} |
487 |
-- Lib/guile/typemaps.i |
487 |
++ Lib/guile/typemaps.i |
Lines 426-432
Link Here
|
426 |
%typecheck(SWIG_TYPECHECK_BOOL) |
426 |
%typecheck(SWIG_TYPECHECK_BOOL) |
427 |
bool, bool&, const bool& |
427 |
bool, bool&, const bool& |
428 |
{ |
428 |
{ |
429 |
$1 = SCM_BOOLP($input) ? 1 : 0; |
429 |
$1 = scm_is_bool($input) ? 1 : 0; |
430 |
} |
430 |
} |
431 |
|
431 |
|
432 |
%typecheck(SWIG_TYPECHECK_DOUBLE) |
432 |
%typecheck(SWIG_TYPECHECK_DOUBLE) |