Exemple #1
0
unsigned SysWrite( int handle, void FAR_PTR *buff, unsigned len )
{
    tiny_ret_t  ret;

    ret = TinyFarWrite( handle, buff, len );
    if( ret < 0 )
        return( (unsigned)-1 );
    return( ret );
}
Exemple #2
0
void XchkClose( where_parm where )
{
    TinyClose( fileHandle );
    fileHandle = TINY_HANDLE_NULL;
}

bool XchkWrite( where_parm where, __segment buff, unsigned *size )
{
    tiny_ret_t      rc;
    unsigned        bytes;

    if( *size >= 0x1000 ) {
        *size = FILE_BLOCK_SIZE >> 4;
    }
    bytes = *size << 4;
    rc = TinyFarWrite( fileHandle, MK_FP( buff, 0 ), bytes );
    return( TINY_OK( rc ) && TINY_INFO( rc ) == bytes );
}

bool XchkRead( where_parm where, __segment *buff )
{
    tiny_ret_t      rc;

    rc = TinyFarRead( fileHandle, MK_FP( *buff, 0 ), FILE_BLOCK_SIZE );
    if( TINY_ERROR( rc ) || TINY_INFO( rc ) != FILE_BLOCK_SIZE ) {
        return( false );
    }
    *buff += FILE_BLOCK_SIZE >> 4;
    return( true );
}