Hi,
just so you don't think there was nothing going on behind the scenes
... I have just (technically) finished XBF's support for
reading/writing block files where blocks may have sub-blocks.
Here's a dump of what the testing program outputs to screen so far.
Note that the timing is severely bad since CodeWarrior's console is
so slow. This will be faster in actual use. The lines beginning with
"processing" are where XBF is loading a block map's contents. You'll
see that it loads the first level at startup, and the sub block's map
when I first request a sub block. The file was created during another
session of XBF. Now I just have to get the compact routine up-to-date
and everything will be fine :-)
----------------------------------------------------------------------
XBlockFile Demo 1.0
Created by M. Uli Kusterer
WARNING:
The buffers in this block file are all fixed-size and limited to
255 characters (=bytes!). XBlockFile supports longer blocks but
this demo will choke on them on input/output. Don't do it!
NOTE:
ANSI's routines for user input currently stop at whitespace, so
please enter no spaces or tabs if you are asked to specify block
data. Again, this is a limit of this demo, not of XBlockFile.
REVISION:
1999-05-25 UK Added deletion of blocks API.
1999-03-31 UK Initial release.
----------------------------------------------------------------------
Creating/opening file "TestFile.ocd"...
processing 0 of 2...
processing 1 of 2...
processing 0 of 2...
processing 1 of 2...
This took 5 ticks.
What do you want to do?
WRITE a new root block to the file.
READ a root block from the file.
set the CURRENT block
ADD a new sub block to the current block
make a SUB block of the current block current
SET the contents of the current block
GET the current block's contents
DELETE the current block
COMPACT the file
IMPORT a file into a block
EXPORT a block to a file
STREAM some data to a block
add a HUGE number of blocks (50 000) w/o feedback
add a BIG number of blocks (20 000).
BIGFAST like "big" but w/o feedback.
DUMP the file's block map to the screen.
QUIT
Enter one of the uppercase keywords: current
Enter ID for current block: 1
What do you want to do?
WRITE a new root block to the file.
READ a root block from the file.
set the CURRENT block
ADD a new sub block to the current block
make a SUB block of the current block current
SET the contents of the current block
GET the current block's contents
DELETE the current block
COMPACT the file
IMPORT a file into a block
EXPORT a block to a file
STREAM some data to a block
add a HUGE number of blocks (50 000) w/o feedback
add a BIG number of blocks (20 000).
BIGFAST like "big" but w/o feedback.
DUMP the file's block map to the screen.
QUIT
Enter one of the uppercase keywords: dump
ID: 1
Offset: 22
Length: 19(19)
Pointer: 0
Ptr Length: 0
Dirty: 0
Not yet saved: 0
Map: 1
<Map not yet loaded>
ID: 2
Offset: 41
Length: 19(19)
Pointer: 0
Ptr Length: 0
Dirty: 0
Not yet saved: 0
Map: 0
What do you want to do?
WRITE a new root block to the file.
READ a root block from the file.
set the CURRENT block
ADD a new sub block to the current block
make a SUB block of the current block current
SET the contents of the current block
GET the current block's contents
DELETE the current block
COMPACT the file
IMPORT a file into a block
EXPORT a block to a file
STREAM some data to a block
add a HUGE number of blocks (50 000) w/o feedback
add a BIG number of blocks (20 000).
BIGFAST like "big" but w/o feedback.
DUMP the file's block map to the screen.
QUIT
Enter one of the uppercase keywords: sub
Enter ID for sub-block to make current block: 1
processing 0 of 1...
What do you want to do?
WRITE a new root block to the file.
READ a root block from the file.
set the CURRENT block
ADD a new sub block to the current block
make a SUB block of the current block current
SET the contents of the current block
GET the current block's contents
DELETE the current block
COMPACT the file
IMPORT a file into a block
EXPORT a block to a file
STREAM some data to a block
add a HUGE number of blocks (50 000) w/o feedback
add a BIG number of blocks (20 000).
BIGFAST like "big" but w/o feedback.
DUMP the file's block map to the screen.
QUIT
Enter one of the uppercase keywords: get
Reading block...
The data is: subblockdata
This took 0 ticks.
What do you want to do?
WRITE a new root block to the file.
READ a root block from the file.
set the CURRENT block
ADD a new sub block to the current block
make a SUB block of the current block current
SET the contents of the current block
GET the current block's contents
DELETE the current block
COMPACT the file
IMPORT a file into a block
EXPORT a block to a file
STREAM some data to a block
add a HUGE number of blocks (50 000) w/o feedback
add a BIG number of blocks (20 000).
BIGFAST like "big" but w/o feedback.
DUMP the file's block map to the screen.
QUIT
Enter one of the uppercase keywords: dump
ID: 1
Offset: 22
Length: 19(19)
Pointer: 0
Ptr Length: 0
Dirty: 0
Not yet saved: 0
Map: 1
ID: 1
Offset: 124
Length: 13(13)
Pointer: 92952872
Ptr Length: 13
Dirty: 0
Not yet saved: 0
Map: 0
ID: 2
Offset: 41
Length: 19(19)
Pointer: 0
Ptr Length: 0
Dirty: 0
Not yet saved: 0
Map: 0
Cheers,
-- M. Uli Kusterer
------------------------------------------------------------
http://www.weblayout.com/witness
'The Witnesses of TeachText are everywhere...'