Implement the "ring buffer in the ring buffer" concept.
Each individual buffer is now potentially a ring buffer of its own. This capability is used for files that are too long to fit in the buffer and will (hopefully) make it easy to have several files on the buffer.
It still needs a lot of testing and polishing but it worked with the files I threw at it (a very long one and a series of moderately short ones, i.e. big but not bigger than the buffer).
NB: It is important to note that the ridx and widx fields of the memory_handle struct are no longer absolute pointers in the main buffer. They are now relative to the handle's data buffer, thus their value is always positive and <= data_len.
git-svn-id: svn://jdgordon.mine.nu/mob@54 9862a28c-4e93-4879-ac26-10afcf840a8f