require '_h2ph_pre.ph';

unless(defined(&_xmsg_h)) {
    eval 'sub _xmsg_h () {1;}' unless defined(&_xmsg_h);
    if(!defined( &__LINUX__)  && !defined( &HAVE_GLIBC)) {
	require 'sys/types.ph';
	require 'sys/param.ph';
    } else {
	require 'linux/types.ph';
	require 'linux/param.ph';
    }
    require 'xfs/xfs_attr.ph';
    eval 'sub MAX_XMSG_SIZE () {(1024*64);}' unless defined(&MAX_XMSG_SIZE);
    eval 'sub MAXHANDLE () {(4*4);}' unless defined(&MAXHANDLE);
    eval 'sub MAXRIGHTS () {8;}' unless defined(&MAXRIGHTS);
    eval 'sub XFS_ANONYMOUSID () {32766;}' unless defined(&XFS_ANONYMOUSID);
    eval 'sub xfs_handle_eq {
        local($p, $q) = @_;
	    eval q((($p)-> &a == ($q)-> &a  && ($p)-> &b == ($q)-> &b  && ($p)-> &c == ($q)-> &c  && ($p)-> &d == ($q)-> &d));
    }' unless defined(&xfs_handle_eq);
    eval 'sub CACHEHANDLESIZE () {80;}' unless defined(&CACHEHANDLESIZE);
    eval 'sub XFS_OPEN_MASK () {0x000f;}' unless defined(&XFS_OPEN_MASK);
    eval 'sub XFS_OPEN_NR () {0x0001;}' unless defined(&XFS_OPEN_NR);
    eval 'sub XFS_OPEN_SR () {0x0002;}' unless defined(&XFS_OPEN_SR);
    eval 'sub XFS_OPEN_NW () {0x0004;}' unless defined(&XFS_OPEN_NW);
    eval 'sub XFS_OPEN_EW () {0x0008;}' unless defined(&XFS_OPEN_EW);
    eval 'sub XFS_ATTR_MASK () {0x0030;}' unless defined(&XFS_ATTR_MASK);
    eval 'sub XFS_ATTR_R () {0x0010;}' unless defined(&XFS_ATTR_R);
    eval 'sub XFS_ATTR_W () {0x0020;}' unless defined(&XFS_ATTR_W);
    eval 'sub XFS_DATA_MASK () {0x00c0;}' unless defined(&XFS_DATA_MASK);
    eval 'sub XFS_DATA_R () {0x0040;}' unless defined(&XFS_DATA_R);
    eval 'sub XFS_DATA_W () {0x0080;}' unless defined(&XFS_DATA_W);
    eval 'sub XFS_LOCK_MASK () {0x0300;}' unless defined(&XFS_LOCK_MASK);
    eval 'sub XFS_LOCK_R () {0x0100;}' unless defined(&XFS_LOCK_R);
    eval 'sub XFS_LOCK_W () {0x0200;}' unless defined(&XFS_LOCK_W);
    eval 'sub XFS_ATTR_VALID () { &XFS_ATTR_R;}' unless defined(&XFS_ATTR_VALID);
    eval 'sub XFS_DATA_VALID () { &XFS_DATA_W;}' unless defined(&XFS_DATA_VALID);
    eval 'sub XFS_DATA_DIRTY () {0x0001;}' unless defined(&XFS_DATA_DIRTY);
    eval 'sub XFS_ATTR_DIRTY () {0x0002;}' unless defined(&XFS_ATTR_DIRTY);
    eval 'sub XFS_TOKEN_GOT {
        local($xn, $tok) = @_;
	    eval q((($xn)-> &tokens & ($tok)));
    }' unless defined(&XFS_TOKEN_GOT);
    eval 'sub XFS_TOKEN_SET {
        local($xn, $tok, $mask) = @_;
	    eval q((($xn)-> &tokens |= (($tok) & ($mask))));
    }' unless defined(&XFS_TOKEN_SET);
    eval 'sub XFS_TOKEN_CLEAR {
        local($xn, $tok, $mask) = @_;
	    eval q((($xn)-> &tokens &= ~(($tok) & ($mask))));
    }' unless defined(&XFS_TOKEN_CLEAR);
    eval 'sub XFS_RIGHT_R () {0x01;}' unless defined(&XFS_RIGHT_R);
    eval 'sub XFS_RIGHT_W () {0x02;}' unless defined(&XFS_RIGHT_W);
    eval 'sub XFS_RIGHT_X () {0x04;}' unless defined(&XFS_RIGHT_X);
    eval("sub XFS_READ () { 1; }") unless defined(&XFS_READ);
    eval("sub XFS_WRITE () { 2; }") unless defined(&XFS_WRITE);
    eval("sub XFS_NONBLOCK () { 4; }") unless defined(&XFS_NONBLOCK);
    eval("sub XFS_APPEND () { 8; }") unless defined(&XFS_APPEND);
    eval("sub XFS_NOREFS () { 1; }") unless defined(&XFS_NOREFS);
    eval("sub XFS_DELETE () { 2; }") unless defined(&XFS_DELETE);
    eval("sub XFS_INVALID_DNLC () { 1; }") unless defined(&XFS_INVALID_DNLC);
    eval 'sub XFS_MSG_VERSION () {0;}' unless defined(&XFS_MSG_VERSION);
    eval 'sub XFS_MSG_WAKEUP () {1;}' unless defined(&XFS_MSG_WAKEUP);
    eval 'sub XFS_MSG_GETROOT () {2;}' unless defined(&XFS_MSG_GETROOT);
    eval 'sub XFS_MSG_INSTALLROOT () {3;}' unless defined(&XFS_MSG_INSTALLROOT);
    eval 'sub XFS_MSG_GETNODE () {4;}' unless defined(&XFS_MSG_GETNODE);
    eval 'sub XFS_MSG_INSTALLNODE () {5;}' unless defined(&XFS_MSG_INSTALLNODE);
    eval 'sub XFS_MSG_GETATTR () {6;}' unless defined(&XFS_MSG_GETATTR);
    eval 'sub XFS_MSG_INSTALLATTR () {7;}' unless defined(&XFS_MSG_INSTALLATTR);
    eval 'sub XFS_MSG_GETDATA () {8;}' unless defined(&XFS_MSG_GETDATA);
    eval 'sub XFS_MSG_INSTALLDATA () {9;}' unless defined(&XFS_MSG_INSTALLDATA);
    eval 'sub XFS_MSG_INACTIVENODE () {10;}' unless defined(&XFS_MSG_INACTIVENODE);
    eval 'sub XFS_MSG_INVALIDNODE () {11;}' unless defined(&XFS_MSG_INVALIDNODE);
    eval 'sub XFS_MSG_OPEN () {12;}' unless defined(&XFS_MSG_OPEN);
    eval 'sub XFS_MSG_PUTDATA () {13;}' unless defined(&XFS_MSG_PUTDATA);
    eval 'sub XFS_MSG_PUTATTR () {14;}' unless defined(&XFS_MSG_PUTATTR);
    eval 'sub XFS_MSG_CREATE () {15;}' unless defined(&XFS_MSG_CREATE);
    eval 'sub XFS_MSG_MKDIR () {16;}' unless defined(&XFS_MSG_MKDIR);
    eval 'sub XFS_MSG_LINK () {17;}' unless defined(&XFS_MSG_LINK);
    eval 'sub XFS_MSG_SYMLINK () {18;}' unless defined(&XFS_MSG_SYMLINK);
    eval 'sub XFS_MSG_REMOVE () {19;}' unless defined(&XFS_MSG_REMOVE);
    eval 'sub XFS_MSG_RMDIR () {20;}' unless defined(&XFS_MSG_RMDIR);
    eval 'sub XFS_MSG_RENAME () {21;}' unless defined(&XFS_MSG_RENAME);
    eval 'sub XFS_MSG_PIOCTL () {22;}' unless defined(&XFS_MSG_PIOCTL);
    eval 'sub XFS_MSG_WAKEUP_DATA () {23;}' unless defined(&XFS_MSG_WAKEUP_DATA);
    eval 'sub XFS_MSG_UPDATEFID () {24;}' unless defined(&XFS_MSG_UPDATEFID);
    eval 'sub XFS_MSG_ADVLOCK () {25;}' unless defined(&XFS_MSG_ADVLOCK);
    eval 'sub XFS_MSG_COUNT () {26;}' unless defined(&XFS_MSG_COUNT);
    eval 'sub XFS_WR_LOCK () {1;}' unless defined(&XFS_WR_LOCK);
    eval 'sub XFS_RD_LOCK () {2;}' unless defined(&XFS_RD_LOCK);
    eval 'sub XFS_UN_LOCK () {3;}' unless defined(&XFS_UN_LOCK);
    eval 'sub XFS_BR_LOCK () {4;}' unless defined(&XFS_BR_LOCK);
}
1;
