From: Dirk B. <db...@us...> - 2006-09-30 15:17:39
|
Update of /cvsroot/win32forth/win32forth-stc/src/kernel In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4224/src/kernel Modified Files: gkernel.f Log Message: - Made fload, needs, loaded? and friends work correctly with the path search. - The path search stuff is mostly rewritten. Know there are two list's. One for the base-folders and one for the sub-folders to search in. Index: gkernel.f =================================================================== RCS file: /cvsroot/win32forth/win32forth-stc/src/kernel/gkernel.f,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gkernel.f 27 Sep 2006 21:38:59 -0000 1.4 --- gkernel.f 30 Sep 2006 15:17:32 -0000 1.5 *************** *** 2478,2484 **** lea ebp, -4 [ebp] ;g ! : (litval) ( n -- ) ! >body code-here _litval move-code 5 + ! \ update the literal in the code --- 2478,2484 ---- lea ebp, -4 [ebp] ;g ! : (litval) ( n -- ) ! >body code-here _litval move-code 5 + ! \ update the literal in the code *************** *** 3581,3585 **** : header ( -<name>- ) \ build a header code-align \ align code section, temporary ! bl word count "header latestxt @ to ofa \ for length calculations of the code generated ; --- 3581,3585 ---- : header ( -<name>- ) \ build a header code-align \ align code section, temporary ! bl word count "header latestxt @ to ofa \ for length calculations of the code generated ; *************** *** 4874,4889 **** ; - : _"open ( a1 n1 -- fileid f1 ) \ open filename a1,n1 - _mlocalbuff dup>r - place \ drop name to openbuf - r@ defext$ add.ext \ add extension if needed - r@ count 2dup pocket place \ and set pocket - r/o open-file \ try to open it - _mlocalfree - ; - - defer "open ( a1 n1 -- fileid f1 ) \ open filename a1,n1 ( but not in editor ) - ' _"open is "open \ return fileid and f1=false=ok - \ -------------------- Get/Set current directory ---------------------------- --- 4874,4877 ---- *************** *** 5078,5084 **** 1 PROC PathIsRelative \ in SHLWAPI.DLL ! | 0 value tempfile \ ptr to tempfile ! : file-rel>abs ( addr len -- ) \ turn rel file name into abs file name 2dup tempfile place \ copy to local buffer (must be 260 bytes) tempfile +null tempfile 1+ --- 5066,5072 ---- 1 PROC PathIsRelative \ in SHLWAPI.DLL ! | 0 value tempfile \ ptr to tempfile ! |: (file-rel>abs) ( addr len -- addr1 len1 ) \ turn rel file name into abs file name 2dup tempfile place \ copy to local buffer (must be 260 bytes) tempfile +null tempfile 1+ *************** *** 5089,5113 **** else 2drop then ! tempfile lowercase defext$ add.ext ; \ lower the string ! : linkfile ( addr len -- nfa ) \ ! file-rel>abs \ make absolute ! tempfile count [ ' files >body ] literal _header-build \ create header for this file ['] isfile xtptr! \ point xt at this function (null) last @ to include-filename ; \ last file loaded ptr ! : included ( addr len -- ) \ load file addr,len into current dictionary ! 2dup "open throw_filenotfound ?throw ! -rot linkfile ! include-file ; ! ! : required ( addr len -- ) file-rel>abs \ make absolute ! tempfile count ! 2dup ['] files >body search-wordlist \ search for file name ! if 3drop \ no, don't load ! else included \ load the file ! then ; \ free local path buffer : $fload ( a1 -- ) \ a1 = counted file string --- 5077,5104 ---- else 2drop then ! tempfile defext$ add.ext \ add extension if needed ! tempfile count ; \ return the abs file name ! defer file-rel>abs ' (file-rel>abs) is file-rel>abs ! ! |: linkfile ( -- nfa ) \ create header for the current file ! tempfile lowercase count \ lower the file name [ ' files >body ] literal _header-build \ create header for this file ['] isfile xtptr! \ point xt at this function (null) last @ to include-filename ; \ last file loaded ptr ! : "open ( a1 n1 -- fileid f1 ) \ open filename a1,n1 file-rel>abs \ make absolute ! _mlocalbuff dup>r ! place \ drop name to openbuf ! r@ defext$ add.ext \ add extension if needed ! r@ count 2dup pocket place \ and set pocket ! r/o open-file \ try to open it ! _mlocalfree ; ! ! : included ( addr len -- ) \ load file addr,len into current dictionary ! "open throw_filenotfound ?throw \ try to open the file ! linkfile \ create a header for the file ! include-file ; \ and load it : $fload ( a1 -- ) \ a1 = counted file string *************** *** 5117,5124 **** /parse-s$ $fload ; ! : requires ( -<filename>- ) \ load if not already loaded ! /parse-s$ count required ; ! ! : sys-fload ( -<filename>- ) \ load "filename" into system dictionary >system fload system> ; --- 5108,5112 ---- /parse-s$ $fload ; ! : sys-fload ( -<filename>- ) \ load "filename" into system space >system fload system> ; |