block_misc wordset

description

-- miscellaneous useful extra words for BLOCK-EXT

Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved.

description: Compatiblity with former standards, miscellaneous useful words. ... for BLOCK-EXT

FORTH
CLOSE-BLOCKFILE ( -- )w32for(); 
 ;

w32for-implementation:

 blockhandle -1 <> if flush close-file drop then
 -1 set-blockfile

in pfe:

 : CLOSE-BLOCKFILE 
   BLOCK-FILE ?DUP IF FLUSH CLOSE-FILE DROP THEN 
   OFF> BLOCK-FILE ;
 
FORTH
OPEN-BLOCKFILE ( "filename" -- )w32for(); 
 ;
 w32for-implementation:
 close-blockfile
 parse-word r/w open-file abort" failed to open block-file"
 set-blockfile
 empty-buffers 
 
FORTH
CREATE-BLOCKFILE ( n "filename" -- )w32for(); 
 ;

w32for-implementation:

 close-blockfile
 parse-word r/w create-file abort" failed to create block-file"
 set-blockfile
 dup b/buf m* blockhandle resize-file
 abort" unable to create a file of that size"
 empty-buffers
 0 do i wipe loop 
 flush

pfe does not wipe the buffers

EXTENSIONS

BLOCK-FILE ( .. )();
as:"block-minus-file";

- loader type P4_DVaL BLOCK-FILE

input.block_file (no special usage info)

EXTENSIONS
SET-BLOCKFILE ( fid -- )win32for(); 
 ;

win32forth uses a system-filedescriptor where -1 means unused in the BLOCKHANDLE, but we use a "FILE*"-like structure, so NULL means NOT-IN-USE. Here we set it.

EXTENSIONS
USING ( 'filename' -- )obsolete(); 
 ;

use filename as a block file OBSOLETE!! use OPEN-BLOCKFILE

EXTENSIONS
USING-NEW ( 'filename' -- )obsolete(); 
 ;

like USING but can create the file OBSOLETE!! use CREATE-BLOCKFILE

EXTENSIONS

B/BUF ( .. )();
as:"b-slash-buf";

( P4_BPBUF )  constant B/BUF

an ordinary constant (no special usage info)