Diff for /gforth/blocks.fs between versions 1.29 and 1.33

version 1.29, 2000/02/28 21:27:07 version 1.33, 2000/09/23 15:46:51
Line 1 Line 1
 \ A less simple implementation of the blocks wordset.   \ A less simple implementation of the blocks wordset. 
   
 \ Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.  \ Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 16 Line 16
   
 \ You should have received a copy of the GNU General Public License  \ You should have received a copy of the GNU General Public License
 \ along with this program; if not, write to the Free Software  \ along with this program; if not, write to the Free Software
 \ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
   
   
 \ A more efficient implementation would use mmap on OSs that  \ A more efficient implementation would use mmap on OSs that
Line 45  Variable last-block Line 45  Variable last-block
 $20 Value buffers  $20 Value buffers
   
 User block-fid  User block-fid
 User offset   0 offset !  \ store 1 here fore 0.4.0 compatibility  User block-offset ( -- addr ) \ gforth
   \G User variable containing the number of the first block (default
   \G since 0.5.0: 0).  Block files created with Gforth versions before
   \G 0.5.0 have the offset 1.  If you use these files you can: @code{1
   \G offset !}; or add 1 to every block number used; or prepend 1024
   \G characters to the file.
   0 block-offset !  \ store 1 here fore 0.4.0 compatibility
   
   ' block-offset alias offset \ !! eliminate this?
   
 : block-cold ( -- )  : block-cold ( -- )
     block-fid off  last-block off      block-fid off  last-block off
Line 109  Defer flush-blocks ( -- ) \ gforth Line 117  Defer flush-blocks ( -- ) \ gforth
   
 : save-buffers  ( -- ) \ block  : save-buffers  ( -- ) \ block
     \G Transfer the contents of each @code{update}d block buffer to      \G Transfer the contents of each @code{update}d block buffer to
     \G mass storage, then mark all block buffers as unassigned.      \G mass storage, then mark all block buffers as assigned-clean.
     block-buffers @      block-buffers @
     buffers 0 ?DO dup save-buffer next-buffer LOOP drop ;      buffers 0 ?DO dup save-buffer next-buffer LOOP drop ;
   
Line 208  User scr ( -- a-addr ) \ block-ext s-c-r Line 216  User scr ( -- a-addr ) \ block-ext s-c-r
     \G Save the current input source specification. Store @i{n} in      \G Save the current input source specification. Store @i{n} in
     \G @code{BLK}, set @code{>IN} to 0 and interpret. When the parse      \G @code{BLK}, set @code{>IN} to 0 and interpret. When the parse
     \G area is exhausted, restore the input source specification.      \G area is exhausted, restore the input source specification.
       loadfilename# @ >r
       2 loadfilename# ! \ "\a block/"
     push-file      push-file
     dup loadline ! blk ! >in off ['] interpret catch      dup loadline ! blk ! >in off ['] interpret catch
     pop-file throw ;      pop-file
       r> loadfilename# !
       throw ;
   
 : thru ( i*x n1 n2 -- j*x ) \ block-ext  : thru ( i*x n1 n2 -- j*x ) \ block-ext
     \G @code{load} the blocks @i{n1} through @i{n2} in sequence.      \G @code{load} the blocks @i{n1} through @i{n2} in sequence.

Removed from v.1.29  
changed lines
  Added in v.1.33


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>