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 125-131
Link Here
|
125 |
else |
125 |
else |
126 |
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); |
126 |
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type); |
127 |
|
127 |
|
128 |
if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) { |
128 |
if (!cdata || scm_is_null(cdata->goops_class) || swig_make_func == SCM_EOL ) { |
129 |
return smob; |
129 |
return smob; |
130 |
} else { |
130 |
} else { |
131 |
/* the scm_make() C function only handles the creation of gf, |
131 |
/* the scm_make() C function only handles the creation of gf, |
Lines 145-151
Link Here
|
145 |
SWIG_Guile_PointerAddress(SCM object) |
145 |
SWIG_Guile_PointerAddress(SCM object) |
146 |
{ |
146 |
{ |
147 |
SCM smob = SWIG_Guile_GetSmob(object); |
147 |
SCM smob = SWIG_Guile_GetSmob(object); |
148 |
if (SCM_NULLP(smob)) return 0; |
148 |
if (scm_is_null(smob)) return 0; |
149 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
149 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
150 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
150 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
151 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
151 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
Lines 158-164
Link Here
|
158 |
SWIG_Guile_PointerType(SCM object) |
158 |
SWIG_Guile_PointerType(SCM object) |
159 |
{ |
159 |
{ |
160 |
SCM smob = SWIG_Guile_GetSmob(object); |
160 |
SCM smob = SWIG_Guile_GetSmob(object); |
161 |
if (SCM_NULLP(smob)) return NULL; |
161 |
if (scm_is_null(smob)) return NULL; |
162 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
162 |
else if (SCM_SMOB_PREDICATE(swig_tag, smob) |
163 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
163 |
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob) |
164 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
164 |
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) { |
Lines 174-180
Link Here
|
174 |
swig_type_info *from; |
174 |
swig_type_info *from; |
175 |
SCM smob = SWIG_Guile_GetSmob(s); |
175 |
SCM smob = SWIG_Guile_GetSmob(s); |
176 |
|
176 |
|
177 |
if (SCM_NULLP(smob)) { |
177 |
if (scm_is_null(smob)) { |
178 |
*result = NULL; |
178 |
*result = NULL; |
179 |
return SWIG_OK; |
179 |
return SWIG_OK; |
180 |
} else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
180 |
} else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
Lines 236-242
Link Here
|
236 |
SWIG_Guile_MarkPointerNoncollectable(SCM s) |
236 |
SWIG_Guile_MarkPointerNoncollectable(SCM s) |
237 |
{ |
237 |
{ |
238 |
SCM smob = SWIG_Guile_GetSmob(s); |
238 |
SCM smob = SWIG_Guile_GetSmob(s); |
239 |
if (!SCM_NULLP(smob)) { |
239 |
if (!scm_is_null(smob)) { |
240 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
240 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
241 |
SCM_SET_CELL_TYPE(smob, swig_tag); |
241 |
SCM_SET_CELL_TYPE(smob, swig_tag); |
242 |
} |
242 |
} |
Lines 249-255
Link Here
|
249 |
SWIG_Guile_MarkPointerDestroyed(SCM s) |
249 |
SWIG_Guile_MarkPointerDestroyed(SCM s) |
250 |
{ |
250 |
{ |
251 |
SCM smob = SWIG_Guile_GetSmob(s); |
251 |
SCM smob = SWIG_Guile_GetSmob(s); |
252 |
if (!SCM_NULLP(smob)) { |
252 |
if (!scm_is_null(smob)) { |
253 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
253 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
254 |
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); |
254 |
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); |
255 |
} |
255 |
} |
Lines 477-496
Link Here
|
477 |
int i; |
477 |
int i; |
478 |
int num_args_passed = 0; |
478 |
int num_args_passed = 0; |
479 |
for (i = 0; i<reqargs; i++) { |
479 |
for (i = 0; i<reqargs; i++) { |
480 |
if (!SCM_CONSP(rest)) |
480 |
if (!scm_is_pair(rest)) |
481 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
481 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
482 |
*dest++ = SCM_CAR(rest); |
482 |
*dest++ = SCM_CAR(rest); |
483 |
rest = SCM_CDR(rest); |
483 |
rest = SCM_CDR(rest); |
484 |
num_args_passed++; |
484 |
num_args_passed++; |
485 |
} |
485 |
} |
486 |
for (i = 0; i<optargs && SCM_CONSP(rest); i++) { |
486 |
for (i = 0; i<optargs && scm_is_pair(rest); i++) { |
487 |
*dest++ = SCM_CAR(rest); |
487 |
*dest++ = SCM_CAR(rest); |
488 |
rest = SCM_CDR(rest); |
488 |
rest = SCM_CDR(rest); |
489 |
num_args_passed++; |
489 |
num_args_passed++; |
490 |
} |
490 |
} |
491 |
for (; i<optargs; i++) |
491 |
for (; i<optargs; i++) |
492 |
*dest++ = SCM_UNDEFINED; |
492 |
*dest++ = SCM_UNDEFINED; |
493 |
if (!SCM_NULLP(rest)) |
493 |
if (!scm_is_null(rest)) |
494 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
494 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
495 |
return num_args_passed; |
495 |
return num_args_passed; |
496 |
} |
496 |
} |
497 |
-- Lib/guile/typemaps.i |
497 |
++ Lib/guile/typemaps.i |
Lines 412-418
Link Here
|
412 |
%typecheck(SWIG_TYPECHECK_BOOL) |
412 |
%typecheck(SWIG_TYPECHECK_BOOL) |
413 |
bool, bool&, const bool& |
413 |
bool, bool&, const bool& |
414 |
{ |
414 |
{ |
415 |
$1 = SCM_BOOLP($input) ? 1 : 0; |
415 |
$1 = scm_is_bool($input) ? 1 : 0; |
416 |
} |
416 |
} |
417 |
|
417 |
|
418 |
%typecheck(SWIG_TYPECHECK_DOUBLE) |
418 |
%typecheck(SWIG_TYPECHECK_DOUBLE) |