From: Jos v.d.V. <jo...@us...> - 2006-08-26 15:25:40
|
Update of /cvsroot/win32forth/win32forth/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16823/src Modified Files: paths.f Log Message: Jos: Depreciated the old path-ptr and replaced path-ptr by search-path Index: paths.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/paths.f,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** paths.f 11 Aug 2006 10:09:45 -0000 1.24 --- paths.f 26 Aug 2006 15:25:32 -0000 1.25 *************** *** 66,70 **** \ ** followed by 0. \n \ ** In runtime it returns adres of the counted string of a path ! create -1 , 0 , MAX-PATH 1+ allot does> \ run-time: ( - path-ptr ) [ 2 cells ] literal + ; --- 66,70 ---- \ ** followed by 0. \n \ ** In runtime it returns adres of the counted string of a path ! create -1 , 0 , MAX-PATH 1+ allot does> \ run-time: ( - path ) [ 2 cells ] literal + ; *************** *** 78,82 **** create path-file$ MAX-PATH 1+ allot ! : path-source ( path-ptr - 2variable_path-source ) \ *G Path-source points to a substring in a path. \n \ ** Path-source returns this adress. --- 78,82 ---- create path-file$ MAX-PATH 1+ allot ! : path-source ( path - 2variable_path-source ) \ *G Path-source points to a substring in a path. \n \ ** Path-source returns this adress. *************** *** 85,93 **** EXTERNAL ! path: path-ptr ! \ *G Path-ptr defines the path buffer for Forth. Applications that let Forth \ ** compile should not change it in a way that Forth is not able too compile. ! : next-path" ( path-ptr -- a1 n1 ) \ *G Get the next path from dir list. dup>r path-source 2@ 2dup ';' scan 2dup 1 /string r> path-source 2! --- 85,100 ---- EXTERNAL ! path: path-ptr deprecated ! \ *G The old functionality had the bad habbit to pass a pointer through a ! \ ** value instead of passing the parameter over the stack. \n ! \ ** Use win32forth\src\Compat\OldPaths.f for the old functionality. \n ! \ ** Words like first-path" and next-path" are now able to handle ! \ ** each path separate without saving and restoring a path-ptr. ! ! path: search-path ! \ *G search-path defines the path buffer for Forth.\n Applications that let Forth \ ** compile should not change it in a way that Forth is not able too compile. ! : next-path" ( path -- a1 n1 ) \ *G Get the next path from dir list. dup>r path-source 2@ 2dup ';' scan 2dup 1 /string r> path-source 2! *************** *** 99,111 **** ; ! : reset-path-source ( path-ptr -- ) \ *G Points the path-source to the whole path. dup>r count r> path-source 2! ; ! : first-path" ( path-ptr -- a1 n1 ) \ *G Get the first forth directory path. dup>r reset-path-source r> next-path" ; ! : "path+ ( a1 n1 path-ptr -- ) \ *G Append a directory to a path. >r 2dup upper --- 106,118 ---- ; ! : reset-path-source ( path -- ) \ *G Points the path-source to the whole path. dup>r count r> path-source 2! ; ! : first-path" ( path -- a1 n1 ) \ *G Get the first forth directory path. dup>r reset-path-source r> next-path" ; ! : "path+ ( a1 n1 path -- ) \ *G Append a directory to a path. >r 2dup upper *************** *** 124,128 **** : "fpath+ ( a1 n1 -- ) \ *G Append a directory to the Forth path. ! path-ptr "path+ ; --- 131,135 ---- : "fpath+ ( a1 n1 -- ) \ *G Append a directory to the Forth path. ! search-path "path+ ; *************** *** 132,136 **** ! : .path ( path-ptr -- ) \ *G Display a directory search path list. count --- 139,143 ---- ! : .path ( path -- ) \ *G Display a directory search path list. count *************** *** 144,148 **** : .fpath ( -- ) \ *G Display the Forth directory search path list. ! path-ptr .path ; --- 151,155 ---- : .fpath ( -- ) \ *G Display the Forth directory search path list. ! search-path .path ; *************** *** 158,162 **** 6 PROC SearchPath ! : full-path { a1 n1 path-ptr \ searchpath$ filename$ current$ -- a2 n2 f1 } \ *G Find file a1,n1 in a path and return the full path. \n \ ** a2,n2 and f1=false, succeeded. --- 165,169 ---- 6 PROC SearchPath ! : full-path { a1 n1 path \ searchpath$ filename$ current$ -- a2 n2 f1 } \ *G Find file a1,n1 in a path and return the full path. \n \ ** a2,n2 and f1=false, succeeded. *************** *** 165,169 **** MAX_PATH 1+ LocalAlloc: current$ current-dir$ count current$ place current$ +null \ save current dir ! path-ptr first-path" begin dup>r searchpath$ place searchpath$ +null searchpath$ volume-indication? \ Test for another volume --- 172,176 ---- MAX_PATH 1+ LocalAlloc: current$ current-dir$ count current$ place current$ +null \ save current dir ! search-path first-path" begin dup>r searchpath$ place searchpath$ +null searchpath$ volume-indication? \ Test for another volume *************** *** 185,189 **** then r> ! while searchpath$ off path-ptr next-path" repeat a1 n1 path-file$ place path-file$ count true \ return input file and error flag current$ char+ $current-dir! not abort" $current-dir!" \ restore current dir --- 192,196 ---- then r> ! while searchpath$ off search-path next-path" repeat a1 n1 path-file$ place path-file$ count true \ return input file and error flag current$ char+ $current-dir! not abort" $current-dir!" \ restore current dir *************** *** 195,199 **** \ *G Initialize the Forth directory search path list. Automatically done at program \ ** initialization and when Paths.f is loaded. ! path-ptr off \ clear path list s" %CURRENTDIR%" "fpath+ s" %FORTHDIR%" "fpath+ --- 202,206 ---- \ *G Initialize the Forth directory search path list. Automatically done at program \ ** initialization and when Paths.f is loaded. ! search-path off \ clear path list s" %CURRENTDIR%" "fpath+ s" %FORTHDIR%" "fpath+ *************** *** 216,222 **** \ ** a2,n2 and f1=false, succeeded. \ first try it in the current directory ! a1 n1 path-ptr full-path -if 3drop \ then try it in the forth directory ! a1 n1 path-ptr full-path then ; --- 223,229 ---- \ ** a2,n2 and f1=false, succeeded. \ first try it in the current directory ! a1 n1 search-path full-path -if 3drop \ then try it in the forth directory ! a1 n1 search-path full-path then ; *************** *** 273,278 **** <AbsRelPath$> ; ! : FindRelativePath ( a1 n1 path-ptr - a2 n2 ) ! \ *G Returns a relative path for file a1 n1 in path-ptr ( first part ). \n \ ** n2=0 means not in search path. dup>r reset-path-source --- 280,285 ---- <AbsRelPath$> ; ! : FindRelativePath ( a1 n1 path - a2 n2 ) ! \ *G Returns a relative path for file a1 n1 in path ( first part ). \n \ ** n2=0 means not in search path. dup>r reset-path-source *************** *** 286,291 **** ; ! : FindRelativeName ( a1 n1 path-ptr - a2 n2 f ) ! \ *G Returns a relative name for file a1 n1 in path-ptr ( last-part ). \n \ ** n2=0 means not in search path. >r 2dup r> FindRelativePath dup 0> --- 293,298 ---- ; ! : FindRelativeName ( a1 n1 path - a2 n2 f ) ! \ *G Returns a relative name for file a1 n1 in path ( last-part ). \n \ ** n2=0 means not in search path. >r 2dup r> FindRelativePath dup 0> |