Annotation of loncom/homework/caparesponse/capa.i, revision 1.5
1.1 albertel 1: %module capa
2: %{
3:
4: %}
1.3 albertel 5:
1.4 albertel 6: %typemap(perl5,in) char** reterror (char* cvalue) {
1.3 albertel 7: SV* tempsv;
1.5 ! albertel 8: int len;
1.3 albertel 9: if (!SvROK($source)) {
10: croak("expected a reference\n");
11: }
12: tempsv = SvRV($source);
13: if ((!SvPOK(tempsv))) {
14: croak("expected a double reference\n");
15: }
1.4 albertel 16: cvalue = SvPV(tempsv,len);
17: $target = &cvalue;
1.3 albertel 18: }
19:
20: %typemap(perl5,argout) char ** reterror {
21: SV *tempsv;
22: tempsv = SvRV($arg);
23: if (($source!=NULL) && (*$source!=NULL)) {
24: sv_setpv(tempsv, *$source);
25: free(*$source);
26: }
27: }
1.1 albertel 28: extern int caparesponse_capa_check_answer(char *response,char *correct,
29: int type,int tol_type,double tolerance,
30: int sig_lbound,int sig_ubound,
31: char *ans_fmt, char *unit_str,
1.2 albertel 32: int calc, char *id_list, char *pts_list,
1.3 albertel 33: char *rndseed, char** reterror);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>