[LON-CAPA-cvs] cvs: loncom /homework/caparesponse capa.i
raeburn
raeburn at source.lon-capa.org
Wed Apr 24 17:11:49 EDT 2024
raeburn Wed Apr 24 21:11:49 2024 EDT
Modified files:
/loncom/homework/caparesponse capa.i
Log:
- Support swig 4.2
- specifying target language as arg in %typemap no longer supported.
- use of $source and $target in typemap declaration no longer supported.
Index: loncom/homework/caparesponse/capa.i
diff -u loncom/homework/caparesponse/capa.i:1.6 loncom/homework/caparesponse/capa.i:1.7
--- loncom/homework/caparesponse/capa.i:1.6 Tue Nov 16 23:37:40 2004
+++ loncom/homework/caparesponse/capa.i Wed Apr 24 21:11:49 2024
@@ -3,49 +3,49 @@
%}
-%typemap(perl5,in) char** reterror (char* cvalue) {
+%typemap(in) char** reterror (char* cvalue) {
SV* tempsv;
int len;
- if (!SvROK($source)) {
+ if (!SvROK($input)) {
croak("expected a reference\n");
}
- tempsv = SvRV($source);
+ tempsv = SvRV($input);
if ((!SvPOK(tempsv))) {
croak("expected a double reference\n");
}
cvalue = SvPV(tempsv,len);
- $target = &cvalue;
+ $1 = &cvalue;
}
-%typemap(perl5,argout) char ** reterror {
+%typemap(argout) char ** reterror {
SV *tempsv;
tempsv = SvRV($arg);
- if (($source!=NULL) && (*$source!=NULL)) {
- sv_setpv(tempsv, *$source);
- free(*$source);
+ if (($1!=NULL) && (*$1!=NULL)) {
+ sv_setpv(tempsv, *$1);
+ free(*$1);
}
}
-%typemap(perl5,in) double* scaled {
+%typemap(in) double* scaled {
double *temp;
- if (!SvROK($source)) {
+ if (!SvROK($input)) {
croak("expected a reference\n");
}
SV* tempsv;
- tempsv = SvRV($source);
+ tempsv = SvRV($input);
if (!SvPOK(tempsv) && !SvIOK(tempsv) && !SvNOK(tempsv)) {
croak("expected a single reference to a scalar\n");
}
temp = malloc(sizeof(double));
*temp = SvNV(tempsv);
- $target = temp;
+ $1 = temp;
}
-%typemap(perl5,argout) double* scaled {
+%typemap(argout) double* scaled {
SV *tempsv;
tempsv = SvRV($arg);
- sv_setnv(tempsv, *$source);
- free($source);
+ sv_setnv(tempsv, *$1);
+ free($1);
}
More information about the LON-CAPA-cvs
mailing list