require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_xfs_xnode_h)) {
    eval 'sub _xfs_xnode_h () {1;}' unless defined(&_xfs_xnode_h);
    require 'sys/types.ph';
    require 'sys/time.ph';
    if(defined(&HAVE_KERNEL_LF_ADVLOCK)) {
	require 'sys/lockf.ph';
    }
    require 'xfs/xfs_attr.ph';
    require 'xfs/xfs_message.ph';
    require 'xfs/xfs_queue.ph';
    if(defined(&__APPLE__)) {
    } else {
    }
    if(defined( &__NetBSD_Version__)  && (defined(&__NetBSD_Version__) ? &__NetBSD_Version__ : 0) >= 105280000) {
    }
    if(defined( &HAVE_KERNEL_LOCKMGR) || defined( &HAVE_KERNEL_DEBUGLOCKMGR)) {
    } else {
    }
    if(defined(&HAVE_KERNEL_LF_ADVLOCK)) {
    }
    eval 'sub XN_HASHSIZE () {101;}' unless defined(&XN_HASHSIZE);
    eval 'sub DATA_FROM_VNODE {
        my($vp) = @_;
	    eval q( &DATA_FROM_XNODE( &VNODE_TO_XNODE($vp)));
    }' unless defined(&DATA_FROM_VNODE);
    eval 'sub DATA_FROM_XNODE {
        my($xp) = @_;
	    eval q((($xp)-> &data));
    }' unless defined(&DATA_FROM_XNODE);
    eval 'sub XNODE_TO_VNODE {
        my($xp) = @_;
	    eval q((($xp)-> &vn));
    }' unless defined(&XNODE_TO_VNODE);
    eval 'sub VNODE_TO_XNODE {
        my($vp) = @_;
	    eval q(( ($vp)-> &v_data));
    }' unless defined(&VNODE_TO_XNODE);
    if(defined( &HAVE_ONE_ARGUMENT_VGET)) {
	eval 'sub xfs_do_vget {
	    my($vp, $lockflag, $proc) = @_;
    	    eval q( &vget(($vp)));
	}' unless defined(&xfs_do_vget);
    }
 elsif(defined( &HAVE_TWO_ARGUMENT_VGET)) {
	eval 'sub xfs_do_vget {
	    my($vp, $lockflag, $proc) = @_;
    	    eval q( &vget(($vp), ($lockflag)));
	}' unless defined(&xfs_do_vget);
    }
 elsif(defined( &HAVE_THREE_ARGUMENT_VGET)) {
	eval 'sub xfs_do_vget {
	    my($vp, $lockflag, $proc) = @_;
    	    eval q( &vget(($vp), ($lockflag), ($proc)));
	}' unless defined(&xfs_do_vget);
    } else {
	die("what\ kind\ of\ vget");
    }
    unless(defined(&HAVE_VOP_T)) {
    }
    if(defined(&LK_INTERLOCK)) {
	eval 'sub HAVE_LK_INTERLOCK () {1;}' unless defined(&HAVE_LK_INTERLOCK);
    } else {
	eval 'sub LK_INTERLOCK () {0;}' unless defined(&LK_INTERLOCK);
    }
    if(defined(&LK_RETRY)) {
	eval 'sub HAVE_LK_RETRY () {1;}' unless defined(&HAVE_LK_RETRY);
    } else {
	eval 'sub LK_RETRY () {0;}' unless defined(&LK_RETRY);
    }
    if(defined(&LK_EXCLUSIVE)) {
	eval 'sub HAVE_LK_EXCLUSIVE () {1;}' unless defined(&HAVE_LK_EXCLUSIVE);
    } else {
	eval 'sub LK_EXCLUSIVE () {1;}' unless defined(&LK_EXCLUSIVE);
    }
    if(defined(&LK_SHARED)) {
	eval 'sub HAVE_LK_SHARED () {1;}' unless defined(&HAVE_LK_SHARED);
    } else {
	eval 'sub LK_SHARED () {1;}' unless defined(&LK_SHARED);
    }
}
1;
