From: Jos v.d.V. <jo...@us...> - 2006-07-16 13:44:49
|
Update of /cvsroot/win32forth/win32forth/doc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20927/doc Added Files: Paths.htm Log Message: Jos: The html file generated with DEX of paths.f --- NEW FILE: Paths.htm --- <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-1" /> <meta name="GENERATOR" content="DexH v03" /> <style type="text/css"> </style> <title> </title> </head> <body> <hr /><h1>Paths -- Multiple search path support </h1><hr /><h2>Glossary </h2><pre><b><a name="0">create &forthdir </a></b></pre><p>A static forth installation directory. </p><pre><b><a name="1">: init-Win32fDirectory { \ kernel$ -- } </a></b></pre><p>Set &forthdir to the folder of the current forth application. <br /> </p><pre><b><a name="2">: .program ( -- ) </a></b></pre><p>Type the program path. </p><pre><b><a name="3">: .forthdir ( -- ) </a></b></pre><p>Type the forth directory. </p><pre><b><a name="4">: "chdir ( a1 n1 -- ) </a></b></pre><p>Set the current directory. </p><pre><b><a name="5">: .dir ( -- ) </a></b></pre><p>Print the current directory. </p><pre><b><a name="6">: chdir ( -<optional_new_directory>- ) </a></b></pre><p>Set the current directory. </p><pre><b><a name="7">: path: ( - ) </a></b></pre><p>Defines a directory search path. <br /> The first 2 cells are used too handle a search path. <br /> The next 260 bytes are reserved for a counted string of a path. <br /> followed by 0. <br /> In runtime it returns adres of the counted string of a path </p><pre><b><a name="8">: path-source ( path-ptr - 2variable_path-source ) </a></b></pre><p>Path-source points to a substring in a path. <br /> Path-source returns this adres. </p><pre><b><a name="9">path: path-ptr </a></b></pre><p>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. </p><pre><b><a name="10">: next-path" ( path-ptr -- a1 n1 ) </a></b></pre><p>Get the next path from dir list. </p><pre><b><a name="11">: reset-path-source ( path-ptr -- ) </a></b></pre><p>Points the path-source to the whole path. </p><pre><b><a name="12">: first-path" ( path-ptr -- a1 n1 ) </a></b></pre><p>Get the first forth directory path. </p><pre><b><a name="13">: "path+ ( a1 n1 path-ptr -- ) </a></b></pre><p>Append a directory to a path. </p><pre><b><a name="14">: "fpath+ ( a1 n1 path-ptr -- ) </a></b></pre><p>Append a directory to a path. </p><pre><b><a name="15">: fpath+ ( -<directory>- ) </a></b></pre><p>Append a directory to the Forth path. </p><pre><b><a name="16">: .path ( path-ptr -- ) </a></b></pre><p>Display a directory search path list. </p><pre><b><a name="17">: .fpath ( -- ) </a></b></pre><p>Display the Forth directory search path list. </p><pre><b><a name="18">: full-path { a1 n1 path-ptr \ searchpath$ filename$ -- a2 n2 f1 } </a></b></pre><p>Find file a1,n1 in a path and return the full path. <br /> a2,n2 and f1=false, succeeded. </p><pre><b><a name="19">: program-path-init ( -- ) </a></b></pre><p>Initialize the Forth directory search path list. </p><pre><b><a name="20">: "path-file { a1 n1 \ current$ -- a2 n2 f1 } </a></b></pre><p>Find file a1,n1 in the Forth path and return the full path. <br /> a2,n2 and f1=false, succeeded. </p><pre><b><a name="21">: n"open ( a1 n1 -- handle f1 ) </a></b></pre><p>Open file a1,n1 with a Forth path search. </p><pre><b><a name="22">: MakeAbsolutePath ( a1 n1 a2 n2 -- a3 ) </a></b></pre><p>Make path a1 n1 absolute to path a2 n2. </p><pre><b><a name="23">: IsPathRelativeTo? { a1 n1 a2 n2 -- f } </a></b></pre><p>Return true if path a1 n1 is relative to path a2 n2 </p><pre><b><a name="24">: MakePathRelativeTo ( a1 n1 a2 n2 -- a3 ) </a></b></pre><p>Make path a1 n1 relative to path a2 n2. </p><pre><b><a name="25">: FindRelativePath ( a1 n1 path-ptr - a2 n2 ) </a></b></pre><p>Returns a releative path for file a1 n1 in path-ptr ( first part ). <br /> n2=0 means not in search path. </p><pre><b><a name="26">: FindRelativeName ( a1 n1 path-ptr - a2 n2 f ) </a></b></pre><p>Returns a releative name for file a1 n1 in path-ptr ( last-part ). <br /> n2=0 means not in search path. </p><pre><b><a name="27">: "LOADED? ( addr len -- flag ) </a></b></pre><p>True if a file addr len is loaded. The filename must cointain a full path. </p><pre><b><a name="28">: LOADED? ( -<name>- -- flag ) { \ current$ } </a></b></pre><p>True if the following file is loaded. The filename may be relative. </p><pre><b><a name="29">: \LOADED- ( -<name>- ) </a></b></pre><p>If the following file IS NOT LOADED interpret line. </p><pre><b><a name="30">: \LOADED ( -<name>- ) </a></b></pre><p> If the following file IS LOADED interpret line. </p><pre><b><a name="31">: NEEDS ( -<name>- ) </a></b></pre><p>Conditionally load file "name" if not loaded. </p><pre><b><a name="32">: "file-clip" { adr len limit \ temp$ pre -- 'adr 'len } </a></b></pre><p>Clip filename to limit. </p> |