From: George H. <geo...@us...> - 2006-08-24 10:14:35
|
Update of /cvsroot/win32forth/win32forth/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4320/win32forth/src Modified Files: Utils.f Log Message: gah:More thread safety and documenting Index: Utils.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/Utils.f,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Utils.f 29 Aug 2005 15:56:27 -0000 1.10 --- Utils.f 24 Aug 2006 10:14:30 -0000 1.11 *************** *** 42,47 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - IN-SYSTEM - : .cur-file ( -- ) ." The current file is: " cur-file count type ; --- 42,45 ---- *************** *** 53,58 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - in-system - : .platform ( -- ) cr ." Platform: Windows " --- 51,54 ---- *************** *** 75,79 **** : .loaded ( -- ) ! also files screendelay 0 to screendelay false to with-tabs? --- 71,75 ---- : .loaded ( -- ) ! also files screendelay 0 to screendelay false to with-tabs? *************** *** 292,295 **** --- 288,292 ---- defer win-abort ' abort is win-abort + : ?win-error ( f1 -- ) \ f1=0=failed \ ?win-error can only be used right after a CALL. It looks at the CALL word, \ finds the PROC and extracts the name of the function. It's a pretty nasty *************** *** 302,307 **** \ cells is the CALL). This is the pointer to the CALL CFA in the PROC; then \ it fetches the PROC address and displays the name. Horrible. - - : ?win-error ( f1 -- ) \ f1=0=failed 0= ?win-error-enabled and if \ build string for error message debugging --- 299,302 ---- *************** *** 522,539 **** IN-APPLICATION ! create TIME-BUF ! here nostack1 ! 0 w, \ +0 year ! 0 w, \ +2 month ! 0 w, \ +4 day of week ! 0 w, \ +6 day of month ! 0 w, \ +8 hour ! 0 w, \ +10 minute ! 0 w, \ +12 second ! 0 w, \ +14 milliseconds ! here swap - constant TIME-LEN ! create date$ 32 allot ! create time$ 32 allot : get-local-time ( -- ) \ get the local computer date and time --- 517,536 ---- IN-APPLICATION ! 16 constant TIME-LEN ! next-user dup @ aligned swap ! ! ! time-len newuser TIME-BUF ! \ +0 year ! \ +2 month ! \ +4 day of week ! \ +6 day of month ! \ +8 hour ! \ +10 minute ! \ +12 second ! \ +14 milliseconds ! ! 32 newuser date$ ! 32 newuser time$ : get-local-time ( -- ) \ get the local computer date and time *************** *** 542,546 **** create compile-version time-len allot \ a place to save the compile time ! get-local-time \ save as part o compiled image time-buf compile-version time-len move \ move time into buffer --- 539,543 ---- create compile-version time-len allot \ a place to save the compile time ! get-local-time \ save as part of compiled image time-buf compile-version time-len move \ move time into buffer *************** *** 647,651 **** 9323846 value SEED3 ! : RANDOM ( n1 -- n2 ) \ get a pseudo random number between 0 and n1 as n2 dup 0= if 1+ then SEED1 177 /MOD 2* SWAP 171 * SWAP - DUP to SEED1 --- 644,649 ---- 9323846 value SEED3 ! : RANDOM ( n1 -- n2 ) \ W32F Utils ! \ *G Get a pseudo random number between 0 and n1 as n2. n2 has the same sign as n1. dup 0= if 1+ then SEED1 177 /MOD 2* SWAP 171 * SWAP - DUP to SEED1 *************** *** 654,658 **** + + SWAP MOD ; ! : RANDOM-INIT ( -- ) \ initialize the random number generator get-local-time time-buf 3 cells + @ to SEED1 --- 652,658 ---- + + SWAP MOD ; ! : RANDOM-INIT ( -- ) \ W32F Utils ! \ *G Initialize the random number generator from the system clock. This is performed at ! \ ** program initialisation. get-local-time time-buf 3 cells + @ to SEED1 *************** *** 669,673 **** \ old Win32s support removed \ September 17th, 2003 - 10:38 dbu ! : _MS ( n1 -- ) \ delay n1 milli-seconds Call Sleep drop ; --- 669,673 ---- \ old Win32s support removed \ September 17th, 2003 - 10:38 dbu ! : _MS ( u -- ) \ delay u milli-seconds or forever if u=-1. Call Sleep drop ; *************** *** 727,734 **** locHdl close-file 3drop ; ! : ftype ( -<filename>- ) /parse-s$ count "ftype ; synonym flist ftype --- 727,738 ---- locHdl close-file 3drop ; ! : ftype ( -<filename>- ) \ W32F System Utils ! \ *G Type the contents of file -<filename>- at the console. If no extension is supplied ! \ ** then the default extension (.f) is applied. Relative paths are relative to the Forth ! \ ** search path. /parse-s$ count "ftype ; synonym flist ftype + \ *G Alternate name. *************** *** 800,804 **** MODULE - --- 804,808 ---- MODULE + \ *Z |