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 123-129
Link Here
|
123 |
else |
123 |
else |
124 |
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); |
124 |
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); |
125 |
|
125 |
|
126 |
if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) { |
126 |
if (!cdata || scm_is_null(cdata->goops_class) || swig_make_func == SCM_EOL ) { |
127 |
return smob; |
127 |
return smob; |
128 |
} else { |
128 |
} else { |
129 |
/* the scm_make() C function only handles the creation of gf, |
129 |
/* the scm_make() C function only handles the creation of gf, |
Lines 143-149
Link Here
|
143 |
SWIG_Guile_PointerAddress(SCM object) |
143 |
SWIG_Guile_PointerAddress(SCM object) |
144 |
{ |
144 |
{ |
145 |
SCM smob = SWIG_Guile_GetSmob(object); |
145 |
SCM smob = SWIG_Guile_GetSmob(object); |
146 |
if (SCM_NULLP(smob)) return 0; |
146 |
if (scm_is_null(smob)) return 0; |
147 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
147 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
148 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
148 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
149 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
149 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
Lines 156-162
Link Here
|
156 |
SWIG_Guile_PointerType(SCM object) |
156 |
SWIG_Guile_PointerType(SCM object) |
157 |
{ |
157 |
{ |
158 |
SCM smob = SWIG_Guile_GetSmob(object); |
158 |
SCM smob = SWIG_Guile_GetSmob(object); |
159 |
if (SCM_NULLP(smob)) return NULL; |
159 |
if (scm_is_null(smob)) return NULL; |
160 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
160 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
161 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
161 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
162 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
162 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
Lines 184-190
Link Here
|
184 |
swig_type_info *from; |
184 |
swig_type_info *from; |
185 |
SCM smob = SWIG_Guile_GetSmob(s); |
185 |
SCM smob = SWIG_Guile_GetSmob(s); |
186 |
|
186 |
|
187 |
if (SCM_NULLP(smob)) { |
187 |
if (scm_is_null(smob)) { |
188 |
*result = NULL; |
188 |
*result = NULL; |
189 |
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; |
189 |
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; |
190 |
#if SCM_MAJOR_VERSION >= 2 |
190 |
#if SCM_MAJOR_VERSION >= 2 |
Lines 250-256
Link Here
|
250 |
SWIG_Guile_MarkPointerNoncollectable(SCM s) |
250 |
SWIG_Guile_MarkPointerNoncollectable(SCM s) |
251 |
{ |
251 |
{ |
252 |
SCM smob = SWIG_Guile_GetSmob(s); |
252 |
SCM smob = SWIG_Guile_GetSmob(s); |
253 |
if (!SCM_NULLP(smob)) { |
253 |
if (!scm_is_null(smob)) { |
254 |
if (SWIG_Guile_IsValidSmob(smob)) { |
254 |
if (SWIG_Guile_IsValidSmob(smob)) { |
255 |
SCM_SET_CELL_TYPE(smob, swig_tag); |
255 |
SCM_SET_CELL_TYPE(smob, swig_tag); |
256 |
} |
256 |
} |
Lines 263-269
Link Here
|
263 |
SWIG_Guile_MarkPointerDestroyed(SCM s) |
263 |
SWIG_Guile_MarkPointerDestroyed(SCM s) |
264 |
{ |
264 |
{ |
265 |
SCM smob = SWIG_Guile_GetSmob(s); |
265 |
SCM smob = SWIG_Guile_GetSmob(s); |
266 |
if (!SCM_NULLP(smob)) { |
266 |
if (!scm_is_null(smob)) { |
267 |
if (SWIG_Guile_IsValidSmob(smob)) { |
267 |
if (SWIG_Guile_IsValidSmob(smob)) { |
268 |
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); |
268 |
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); |
269 |
} |
269 |
} |
Lines 484-503
Link Here
|
484 |
int i; |
484 |
int i; |
485 |
int num_args_passed = 0; |
485 |
int num_args_passed = 0; |
486 |
for (i = 0; i<reqargs; i++) { |
486 |
for (i = 0; i<reqargs; i++) { |
487 |
if (!SCM_CONSP(rest)) |
487 |
if (!scm_is_pair(rest)) |
488 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
488 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
489 |
*dest++ = SCM_CAR(rest); |
489 |
*dest++ = SCM_CAR(rest); |
490 |
rest = SCM_CDR(rest); |
490 |
rest = SCM_CDR(rest); |
491 |
num_args_passed++; |
491 |
num_args_passed++; |
492 |
} |
492 |
} |
493 |
for (i = 0; i<optargs && SCM_CONSP(rest); i++) { |
493 |
for (i = 0; i<optargs && scm_is_pair(rest); i++) { |
494 |
*dest++ = SCM_CAR(rest); |
494 |
*dest++ = SCM_CAR(rest); |
495 |
rest = SCM_CDR(rest); |
495 |
rest = SCM_CDR(rest); |
496 |
num_args_passed++; |
496 |
num_args_passed++; |
497 |
} |
497 |
} |
498 |
for (; i<optargs; i++) |
498 |
for (; i<optargs; i++) |
499 |
*dest++ = SCM_UNDEFINED; |
499 |
*dest++ = SCM_UNDEFINED; |
500 |
if (!SCM_NULLP(rest)) |
500 |
if (!scm_is_null(rest)) |
501 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
501 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
502 |
return num_args_passed; |
502 |
return num_args_passed; |
503 |
} |
503 |
} |
504 |
-- /Lib/guile/typemaps.i |
504 |
++ /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) |