require '_h2ph_pre.ph';

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