dougm 01/05/04 14:21:57 Modified: lib/ModPerl WrapXS.pm t/response/TestAPI request_rec.pm xs typemap xs/maps apr_types.map Log: apr_time_t needs conversion to/from time_t Revision Changes Path 1.17 +3 -1 modperl-2.0/lib/ModPerl/WrapXS.pm Index: WrapXS.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- WrapXS.pm 2001/05/04 03:39:24 1.16 +++ WrapXS.pm 2001/05/04 21:21:39 1.17 @@ -501,6 +501,7 @@ my %typemap = ( 'Apache::RequestRec' => 'T_APACHEOBJ', + 'apr_time_t' => 'T_APR_TIME', ); sub write_typemap { @@ -521,7 +522,8 @@ print $fh "$class\t$typemap\n"; } else { - print $fh "$type\tT_$class\n"; + my $typemap = $typemap{$type} || "T_$class"; + print $fh "$type\t$typemap\n"; } } 1.4 +6 -1 modperl-2.0/t/response/TestAPI/request_rec.pm Index: request_rec.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/request_rec.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- request_rec.pm 2001/04/30 04:39:26 1.3 +++ request_rec.pm 2001/05/04 21:21:44 1.4 @@ -8,7 +8,7 @@ sub handler { my $r = shift; - plan $r, tests => 35; + plan $r, tests => 36; #Apache->request($r); #PerlOptions +GlobalRequest takes care my $gr = Apache->request; @@ -94,6 +94,11 @@ ok $r->uri; ok $r->filename; + + my $mtime = (stat __FILE__)[9]; + $r->mtime($mtime); + + ok $r->mtime == $mtime; ok $r->path_info || 1; 1.4 +6 -0 modperl-2.0/xs/typemap Index: typemap =================================================================== RCS file: /home/cvs/modperl-2.0/xs/typemap,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- typemap 2001/04/30 07:17:48 1.3 +++ typemap 2001/05/04 21:21:49 1.4 @@ -11,6 +11,9 @@ T_VPTR sv_setiv($arg, PTR2IV($var)); +T_APR_TIME + sv_setnv($arg, (NV)($var / APR_USEC_PER_SEC)); + ###################################################################### INPUT T_APACHEOBJ @@ -21,6 +24,9 @@ T_VPTR $var = INT2PTR($type,SvIV(SvROK($arg) ? SvRV($arg) : $arg)) + +T_APR_TIME + $var = (apr_time_t)(SvNV($arg) * APR_USEC_PER_SEC) T_CHAR_LEN $var = (char *)SvPV($arg, ${var}_len) 1.5 +1 -1 modperl-2.0/xs/maps/apr_types.map Index: apr_types.map =================================================================== RCS file: /home/cvs/modperl-2.0/xs/maps/apr_types.map,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- apr_types.map 2001/04/19 17:41:40 1.4 +++ apr_types.map 2001/05/04 21:21:54 1.5 @@ -123,7 +123,7 @@ apr_socklen_t | IV apr_ssize_t | IV apr_size_t | IV -apr_time_t | IV +apr_time_t | NV apr_interval_time_t | IV apr_gid_t | IV apr_uid_t | IV