require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NFS_XDR_SUBS_H_)) {
    eval 'sub _NFS_XDR_SUBS_H_ () {1;}' unless defined(&_NFS_XDR_SUBS_H_);
    eval 'sub fxdr_unsigned {
        my($t, $v) = @_;
	    eval q((($t) &ntohl(( &int32_t)($v))));
    }' unless defined(&fxdr_unsigned);
    eval 'sub txdr_unsigned {
        my($v) = @_;
	    eval q(( &htonl(( &int32_t)($v))));
    }' unless defined(&txdr_unsigned);
    eval 'sub fxdr_nfsv2time {
        my($f, $t) = @_;
	    eval q({ ($t)-> &tv_sec =  &ntohl((($f))-> &nfsv2_sec);  &if ((($f))-> &nfsv2_usec != 0xffffffff) ($t)-> &tv_nsec = 1000*  &ntohl((($f))-> &nfsv2_usec);  &else ($t)-> &tv_nsec = 0; });
    }' unless defined(&fxdr_nfsv2time);
    eval 'sub txdr_nfsv2time {
        my($f, $t) = @_;
	    eval q({ (($t))-> &nfsv2_sec =  &htonl(($f)-> &tv_sec);  &if (($f)-> &tv_nsec != -1) (($t))-> &nfsv2_usec =  &htonl(($f)-> &tv_nsec / 1000);  &else (($t))-> &nfsv2_usec = 0xffffffff; });
    }' unless defined(&txdr_nfsv2time);
    eval 'sub fxdr_nfsv3time {
        my($f, $t) = @_;
	    eval q({ ($t)-> &tv_sec =  &ntohl((($f))-> &nfsv3_sec); ($t)-> &tv_nsec =  &ntohl((($f))-> &nfsv3_nsec); });
    }' unless defined(&fxdr_nfsv3time);
    eval 'sub txdr_nfsv3time {
        my($f, $t) = @_;
	    eval q({ (($t))-> &nfsv3_sec =  &htonl(($f)-> &tv_sec); (($t))-> &nfsv3_nsec =  &htonl(($f)-> &tv_nsec); });
    }' unless defined(&txdr_nfsv3time);
    eval 'sub fxdr_hyper {
        my($f) = @_;
	    eval q((((( &u_quad_t) &ntohl((( &u_int32_t *)($f))[0])) << 32) | ( &u_quad_t)( &ntohl((( &u_int32_t *)($f))[1]))));
    }' unless defined(&fxdr_hyper);
    eval 'sub txdr_hyper {
        my($f, $t) = @_;
	    eval q({ (( &u_int32_t *)($t))[0] =  &htonl(( &u_int32_t)(($f) >> 32)); (( &u_int32_t *)($t))[1] =  &htonl(( &u_int32_t)(($f) & 0xffffffff)); });
    }' unless defined(&txdr_hyper);
}
1;
