Changeset 144 for trunk/orca/files.c

Show
Ignore:
Timestamp:
05/11/06 14:23:03 (3 years ago)
Author:
krobillard
Message:

Native arguments are now kept on the stack until after the call and the
result is now always put into a1.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/files.c

    r136 r144  
    2626extern int orIsDir( const char* path ); 
    2727extern int orFileModified( const char* path, OValue* res ); 
    28 extern void orReadDir( const char* filename ); 
     28extern void orReadDir( OValue*, const char* filename ); 
    2929extern void orNowNative( OValue* a1 ); 
    3030extern void orChangeDirNative( OValue* a1 ); 
     
    126126    OString* str = orSTRING(a1); 
    127127    orTermCStr( str ); 
    128     status = orFileModified( str->charArray + a1->series.it, orRESULT ); 
     128    status = orFileModified( str->charArray + a1->series.it, a1 ); 
    129129    if( status < 0 ) 
    130130    { 
     
    248248#define REF_READ_SIZE       a1+6 
    249249 
     250/* 
     251    read: native [ 
     252        source [file! port!] 
     253        /binary 
     254        /lines 
     255        /skip length [number!] 
     256        /part size [number!] 
     257    ] 
     258*/ 
    250259OR_NATIVE( orReadNative ) 
    251260{ 
     
    257266 
    258267        orTermCStr( str ); 
    259  
    260268        fn = str->charArray + a1->series.it; 
     269 
    261270        n = orIsDir( fn ); 
    262271        if( n < 0 ) 
     
    266275        else if( n == 1 ) 
    267276        { 
    268             orReadDir( fn ); 
     277            // TODO: Hold a1 from GC (or copy fn). 
     278            orReadDir( a1, fn ); 
    269279        } 
    270280        else 
     
    361371 
    362372        assert( (devID > -1) && (devID < arr->used) ); 
    363         ((OPortDevice**) arr->buf)[ devID ]->read( &a1->ctx ); 
     373        ((OPortDevice**) arr->buf)[ devID ]->read( &a1->ctx, a1 ); 
    364374    } 
    365375}