11
11
* Mzscheme language module for SWIG.
12
12
* ----------------------------------------------------------------------------- */
14
char cvsroot_mzscheme_cxx[] = "$Id: mzscheme.cxx 12558 2011-03-26 23:25:14Z wsfulton $";
14
char cvsroot_mzscheme_cxx[] = "$Id: mzscheme.cxx 12830 2011-10-30 21:51:50Z wsfulton $";
16
16
#include "swigmod.h"
250
250
ParmList *parms = Getattr(n, "parms");
251
251
SwigType *type = Getattr(n, "type");
252
252
String *name = NewString("caller");
253
Setattr(n, "wrap:action", Swig_cresult(type, "result", Swig_cfunction_call(name, parms)));
253
Setattr(n, "wrap:action", Swig_cresult(type, Swig_cresult_name(), Swig_cfunction_call(name, parms)));
403
403
String *actioncode = emit_action(n);
405
405
// Now have return value, figure out what to do with it.
406
if ((tm = Swig_typemap_lookup_out("out", n, "result", f, actioncode))) {
407
Replaceall(tm, "$source", "result");
406
if ((tm = Swig_typemap_lookup_out("out", n, Swig_cresult_name(), f, actioncode))) {
407
Replaceall(tm, "$source", Swig_cresult_name());
408
408
Replaceall(tm, "$target", "values[0]");
409
409
Replaceall(tm, "$result", "values[0]");
410
410
if (GetFlag(n, "feature:new"))
426
426
// Look for any remaining cleanup
428
428
if (GetFlag(n, "feature:new")) {
429
if ((tm = Swig_typemap_lookup("newfree", n, "result", 0))) {
430
Replaceall(tm, "$source", "result");
429
if ((tm = Swig_typemap_lookup("newfree", n, Swig_cresult_name(), 0))) {
430
Replaceall(tm, "$source", Swig_cresult_name());
431
431
Printv(f->code, tm, "\n", NIL);
434
434
// Free any memory allocated by the function being wrapped..
436
if ((tm = Swig_typemap_lookup("ret", n, "result", 0))) {
437
Replaceall(tm, "$source", "result");
436
if ((tm = Swig_typemap_lookup("ret", n, Swig_cresult_name(), 0))) {
437
Replaceall(tm, "$source", Swig_cresult_name());
438
438
Printv(f->code, tm, "\n", NIL);
440
440
// Wrap things up (in a manner of speaking)