| Defer flush-blocks |
Defer flush-blocks |
| |
|
| : open-blocks ( addr u -- ) \ gforth |
: open-blocks ( addr u -- ) \ gforth |
| \g use the file, whose name is given by @var{addr u}, as blocks file |
\g Use the file, whose name is given by @var{addr u}, as the blocks file. |
| 2dup open-fpath-file 0<> |
2dup open-fpath-file 0<> |
| if |
if |
| r/w bin create-file throw |
r/w bin create-file throw |
| block-fid ! ; |
block-fid ! ; |
| |
|
| : use ( "file" -- ) \ gforth |
: use ( "file" -- ) \ gforth |
| \g use @var{file} as blocks file |
\g Use @var{file} as the blocks file. |
| name open-blocks ; |
name open-blocks ; |
| |
|
| \ the file is opened as binary file, since it either will contain text |
\ the file is opened as binary file, since it either will contain text |
| i 2 .r space scr @ block i 64 * chars + 64 type cr |
i 2 .r space scr @ block i 64 * chars + 64 type cr |
| loop ; |
loop ; |
| |
|
| : (source) ( -- addr len ) |
: (source) ( -- c-addr u ) |
| blk @ ?dup |
blk @ ?dup |
| IF block chars/block |
IF block chars/block |
| ELSE tib #tib @ |
ELSE tib #tib @ |
| THEN ; |
THEN ; |
| |
|
| ' (source) IS source |
' (source) IS source ( -- c-addr u ) \ core |
| |
\G @var{c-addr} is the address of the input buffer and @var{u} is the |
| |
\G number of characters in it. |
| |
|
| : load ( i*x n -- j*x ) \ block |
: load ( i*x n -- j*x ) \ block |
| push-file |
push-file |