Changeset 145 for trunk/orca

Show
Ignore:
Timestamp:
05/11/06 15:55:43 (3 years ago)
Author:
krobillard
Message:

orReadDir() now holds new block.

Location:
trunk/orca
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/files.c

    r144 r145  
    259259OR_NATIVE( orReadNative ) 
    260260{ 
    261     if( a1->type == OT_FILE ) 
     261    if( orIs(a1, OT_FILE) ) 
    262262    { 
    263263        int n; 
     
    275275        else if( n == 1 ) 
    276276        { 
    277             // TODO: Hold a1 from GC (or copy fn). 
    278277            orReadDir( a1, fn ); 
    279278        } 
     
    365364        } 
    366365    } 
    367     else if( a1->type == OT_PORT ) 
     366    else if( orIs(a1, OT_PORT) ) 
    368367    { 
    369368        OArray* arr = &orEnv->devices; 
     
    541540 
    542541 
    543 OR_NATIVE( orDecompressNative ) 
     542OR_NATIVE_PUB( orDecompressNative ) 
    544543{ 
    545544#define BUF_LOW     32 
  • trunk/orca/unix/os.c

    r144 r145  
    168168    if( dir ) 
    169169    { 
     170        OIndex hold; 
     171        OIndex blkN; 
    170172        OBlock* blk = orMakeBlock( 0 ); 
     173 
     174        blkN = orBlockN(blk); 
     175        hold = orHold( OT_BLOCK, blkN ); 
    171176 
    172177        while( (entry = readdir( dir )) ) 
     
    180185        closedir( dir ); 
    181186 
    182         orResult( OT_BLOCK, blk - orBLOCKS ); 
    183         return; 
    184     } 
    185  
    186     orResultFALSE; 
     187        orRelease( hold ); 
     188        orResultBLOCK( blkN ); 
     189    } 
     190    else 
     191    { 
     192        orResultFALSE; 
     193    } 
    187194} 
    188195 
  • trunk/orca/win32/os.c

    r144 r145  
    191191    if( handle != -1 ) 
    192192    { 
     193        OIndex hold; 
     194        OIndex blkN; 
    193195        OBlock* blk = orMakeBlock( 0 ); 
    194196 
     197        blkN = orBlockN(blk); 
     198        hold = orHold( OT_BLOCK, blkN ); 
     199 
    195200        do 
    196201        { 
     
    201206        _findclose( handle ); 
    202207 
    203         orResult( OT_BLOCK, blk - orBLOCKS ); 
    204         return; 
    205     } 
    206  
    207     orResultFALSE; 
     208        orRelease( hold ); 
     209        orResultBLOCK( blkN ); 
     210    } 
     211    else 
     212    { 
     213        orResultFALSE; 
     214    } 
    208215} 
    209216