/* // Special relative paths: // 1. ::path, path relative to the current source code file; // 2. :path, path relative to the current working directory; */ static void DaoIO_MakePath( DaoProcess *proc, DString *path ) { DString_ToMBS( path ); if( path->size ==0 ) return; if( path->mbs[0] != ':' ) return; if( path->mbs[1] == ':' ){ DString_Erase( path, 0, 2 ); Dao_MakePath( proc->activeNamespace->path, path ); return; } DString_Erase( path, 0, 1 ); Dao_MakePath( proc->vmSpace->pathWorking, path ); }
int DaoxResource_SearchFile( DaoxResource *self, DString *fname, DString *search ) { DString *tmp; if( DaoVmSpace_SearchResource( self->vmSpace, fname, search ) ) return 1; tmp = DString_Copy( fname ); Dao_MakePath( search, tmp ); if( DaoVmSpace_TestFile( self->vmSpace, tmp ) ){ DString_Assign( fname, tmp ); DString_Delete( tmp ); return 1; } DString_Delete( tmp ); return 0; }