Hi,

I'm trying to write an NBD driver for XZ files.  This requires random
access to the files.

So far I've have loaded the index from the file, and I'm using
lzma_index_iter_locate (successfully) to locate the block and
uncompressed offset that contains the byte of interest.  However I'm
stuck as to where I go from there.

I am able to decode the block header using lzma_block_header_decode.
But should I need to do that?  Isn't the block already "loaded" in the
index?

I'm also able to read the data from the block (although decoding fails
at the end of the block -- I don't understand why).

Here is my current code -- see especially the function 'xzfile_pread'
in the first file:

http://oirase.annexia.org/tmp/xzfile.c
http://oirase.annexia.org/tmp/xzfile.h
http://oirase.annexia.org/tmp/xz.c

I suppose the answer is "no", but is this stuff documented anywhere?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)

Reply via email to