Differentiate EOF blocks and the terminal block
commit14c747867b76d75448d8d1557b3b149cf9f5febd
authorPetr Tesarik <petr@tesarici.cz>
Mon, 22 Oct 2012 20:05:46 +0000 (22 22:05 +0200)
committerPetr Tesarik <petr@tesarici.cz>
Mon, 22 Oct 2012 20:05:46 +0000 (22 22:05 +0200)
treebae4335a25a495f2dc46786ecc6ff48fdb7be3ea
parentb5de179025527f164ee13df71b8d5adeba34fe75
Differentiate EOF blocks and the terminal block

The EOF flag was used for two different things:

1. for the terminal block
2. for blocks that can't be read from disk (cf. the check in
   hed_is_inner_virtual)

This is wrong. There can always be only one terminal block, but there
can be multiple virtual blocks beyond EOF, e.g. when you go beyond EOF
and modify some bytes.

So, the new semantic is:

1. HED_BLOCK_EOF is given to all blocks that are past file EOF (and
   hence cannot be devirtualized).
2. HED_BLOCK_TERMINAL is given only to one terminating block which is
   always last in the list and serves as a termination mark for list
   walks (and also for positioning the cursor beyond logical EOF).
libhed/file.c
libhed/file.h
libhed/file_priv.h