File:
[LON-CAPA] /
loncom /
homework /
caparesponse /
capa.i
Revision
1.5:
download - view:
text,
annotated -
select for diffs
Mon Mar 22 01:43:28 2004 UTC (20 years, 5 months ago) by
albertel
Branches:
MAIN
CVS tags:
version_1_2_X,
version_1_2_1,
version_1_2_0,
version_1_1_99_5,
version_1_1_99_4,
version_1_1_99_3,
version_1_1_99_2,
version_1_1_99_1,
version_1_1_99_0,
HEAD
- that's right in C you need/should declare all variables at the beginning of the function
%module capa
%{
%}
%typemap(perl5,in) char** reterror (char* cvalue) {
SV* tempsv;
int len;
if (!SvROK($source)) {
croak("expected a reference\n");
}
tempsv = SvRV($source);
if ((!SvPOK(tempsv))) {
croak("expected a double reference\n");
}
cvalue = SvPV(tempsv,len);
$target = &cvalue;
}
%typemap(perl5,argout) char ** reterror {
SV *tempsv;
tempsv = SvRV($arg);
if (($source!=NULL) && (*$source!=NULL)) {
sv_setpv(tempsv, *$source);
free(*$source);
}
}
extern int caparesponse_capa_check_answer(char *response,char *correct,
int type,int tol_type,double tolerance,
int sig_lbound,int sig_ubound,
char *ans_fmt, char *unit_str,
int calc, char *id_list, char *pts_list,
char *rndseed, char** reterror);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>