require '_h2ph_pre.ph';

unless(defined(&_TCFS_RW_H_)) {
    eval 'sub _TCFS_RW_H_ () {1;}' unless defined(&_TCFS_RW_H_);
    require 'miscfs/tcfs/tcfs_fileinfo.ph';
    eval 'sub ROFF {
        local($x) = @_;
	    eval q((($x)-> &off% &BLOCKSIZE));
    }' unless defined(&ROFF);
    eval 'sub LAST {
        local($x) = @_;
	    eval q((($x)-> &off+($x)-> &req-1));
    }' unless defined(&LAST);
    eval 'sub BOFF {
        local($x) = @_;
	    eval q(((($x)-> &off/ &BLOCKSIZE)* &BLOCKSIZE));
    }' unless defined(&BOFF);
    eval 'sub FOFF {
        local($x) = @_;
	    eval q(( &LAST(($x))+ &BLOCKSIZE-( &LAST(($x))% &BLOCKSIZE+1)));
    }' unless defined(&FOFF);
    eval 'sub P_BOFF {
        local($x) = @_;
	    eval q(((($x)-> &off/ &SBLOCKSIZE)* &SBLOCKSIZE));
    }' unless defined(&P_BOFF);
    eval 'sub P_FOFF {
        local($x) = @_;
	    eval q(( &LAST(($x))+ &SBLOCKSIZE-( &LAST(($x))% &SBLOCKSIZE+1)));
    }' unless defined(&P_FOFF);
    eval 'sub SPURE {
        local($x) = @_;
	    eval q((($x)-> &req% &SBLOCKSIZE?( &SBLOCKSIZE-($x)-> &req% &SBLOCKSIZE):0));
    }' unless defined(&SPURE);
    eval 'sub D_BOFF {
        local($o) = @_;
	    eval q(((($o)/ &BLOCKSIZE)* &BLOCKSIZE));
    }' unless defined(&D_BOFF);
    eval 'sub D_FOFF {
        local($o) = @_;
	    eval q((($o)+ &BLOCKSIZE-(($o)% &BLOCKSIZE+1)));
    }' unless defined(&D_FOFF);
    eval 'sub D_PFOFF {
        local($o) = @_;
	    eval q((($o)+ &SBLOCKSIZE-(($o)% &SBLOCKSIZE+1)));
    }' unless defined(&D_PFOFF);
    eval 'sub D_SPURE {
        local($o) = @_;
	    eval q((($o)% &SBLOCKSIZE?( &SBLOCKSIZE-($o)% &SBLOCKSIZE):0));
    }' unless defined(&D_SPURE);
    eval 'sub D_NOBLK {
        local($o) = @_;
	    eval q((($o)/ &BLOCKSIZE+($o% &BLOCKSIZE?1:0)));
    }' unless defined(&D_NOBLK);
    eval 'sub TCFS_NONE () {0;}' unless defined(&TCFS_NONE);
    eval 'sub TCFS_READ_C1 () {1;}' unless defined(&TCFS_READ_C1);
    eval 'sub TCFS_READ_C2 () {2;}' unless defined(&TCFS_READ_C2);
    eval 'sub TCFS_WRITE_C1 () {3;}' unless defined(&TCFS_WRITE_C1);
    eval 'sub TCFS_WRITE_C2 () {4;}' unless defined(&TCFS_WRITE_C2);
    eval 'sub TCFS_WRITE_C3 () {5;}' unless defined(&TCFS_WRITE_C3);
    eval 'sub TCFS_WRITE_C4 () {6;}' unless defined(&TCFS_WRITE_C4);
    eval 'sub TCFS_WRITE_C5 () {7;}' unless defined(&TCFS_WRITE_C5);
}
1;
