"BLOCK-Misc Compatibility words"

block_misc 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/FORTH block_misc ordinary primitive

* 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/FORTH block_misc ordinary primitive

* 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

FORTH/FORTH block_misc ordinary primitive

EXTENSIONS BLOCK-FILE

[] no special info, see general notes

EXTENSIONS block_misc loader code P4_DVaL

* 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 block_misc ordinary primitive

* USING ( 'filename' -- ) obsolete

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

EXTENSIONS block_misc ordinary primitive

* USING-NEW ( 'filename' -- ) obsolete

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

EXTENSIONS block_misc ordinary primitive

B/BUF

[] no special info, see general notes

EXTENSIONS block_misc ordinary constant