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 |
#if SCM_MAJOR_VERSION >= 2 |
179 |
#if SCM_MAJOR_VERSION >= 2 |
Lines 240-246
Link Here
|
240 |
SWIG_Guile_MarkPointerNoncollectable(SCM s) |
240 |
SWIG_Guile_MarkPointerNoncollectable(SCM s) |
241 |
{ |
241 |
{ |
242 |
SCM smob = SWIG_Guile_GetSmob(s); |
242 |
SCM smob = SWIG_Guile_GetSmob(s); |
243 |
if (!SCM_NULLP(smob)) { |
243 |
if (!scm_is_null(smob)) { |
244 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
244 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
245 |
SCM_SET_CELL_TYPE(smob, swig_tag); |
245 |
SCM_SET_CELL_TYPE(smob, swig_tag); |
246 |
} |
246 |
} |
Lines 253-259
Link Here
|
253 |
SWIG_Guile_MarkPointerDestroyed(SCM s) |
253 |
SWIG_Guile_MarkPointerDestroyed(SCM s) |
254 |
{ |
254 |
{ |
255 |
SCM smob = SWIG_Guile_GetSmob(s); |
255 |
SCM smob = SWIG_Guile_GetSmob(s); |
256 |
if (!SCM_NULLP(smob)) { |
256 |
if (!scm_is_null(smob)) { |
257 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
257 |
if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) { |
258 |
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); |
258 |
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag); |
259 |
} |
259 |
} |
Lines 472-491
Link Here
|
472 |
int i; |
472 |
int i; |
473 |
int num_args_passed = 0; |
473 |
int num_args_passed = 0; |
474 |
for (i = 0; i<reqargs; i++) { |
474 |
for (i = 0; i<reqargs; i++) { |
475 |
if (!SCM_CONSP(rest)) |
475 |
if (!scm_is_pair(rest)) |
476 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
476 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
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 = 0; i<optargs && SCM_CONSP(rest); i++) { |
481 |
for (i = 0; i<optargs && scm_is_pair(rest); i++) { |
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<optargs; i++) |
486 |
for (; i<optargs; i++) |
487 |
*dest++ = SCM_UNDEFINED; |
487 |
*dest++ = SCM_UNDEFINED; |
488 |
if (!SCM_NULLP(rest)) |
488 |
if (!scm_is_null(rest)) |
489 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
489 |
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure")); |
490 |
return num_args_passed; |
490 |
return num_args_passed; |
491 |
} |
491 |
} |
492 |
-- /Lib/guile/typemaps.i |
492 |
++ /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) |