How to apply xdelta generated patches

41 views
Skip to first unread message

LCID Fire

unread,
Jun 6, 2013, 5:35:27 AM6/6/13
to open-...@googlegroups.com
I try to use openvc for applying a xdelta generated diff on a file but I am stumped by the language and by the streaming interface.
You use the word dictionary a lot in the docs, but I cannot find a definition, what dictionary is to you.
Also DecodeChunk is somewhat vague, what data it wants. I assume it wants the diff data. If this is true, how does it handle over or underruns and how is it used correctly?

Could someone shed some light on how this thing is to be used, since I can only find very little examples online (is there maybe a better alternative?).

open-vcdiff

unread,
Jun 10, 2013, 3:06:01 PM6/10/13
to open-...@googlegroups.com
Hi LCID Fire:

Thanks much for using open-vcdiff, and for sharing your feedback.
 
On Thursday, June 6, 2013 2:35:27 AM UTC-7, LCID Fire wrote:
I try to use openvc for applying a xdelta generated diff on a file but I am stumped by the language and by the streaming interface.
You use the word dictionary a lot in the docs, but I cannot find a definition, what dictionary is to you.

Sorry for the confusion.  I've added a note to the document "How to use open-vcdiff":
In this document, and in the source code, the term "dictionary" is used interchangeably with the term "source" (or "source file" or "source data") as defined in RFC 3284.

Also DecodeChunk is somewhat vague, what data it wants. I assume it wants the diff data.

The input to DecodeChunk() is a portion of the delta file.
If you have an entire delta file available in memory, you can use the simple VCDiffDecoder class and call Decode().
If you are processing a delta file that comes to you in chunks (e.g. from disk blocks or network packets), you can use a VCDiffStreamingDecoder and pass each chunk as you receive it to DecodeChunk().  This uses an STL string to store the output, and may call append() on that string, which may require reallocating memory from the heap and copying the string contents into it.  If you'd like to use a more efficient append() operation against some other type, you can use DecodeChunkToInterface().
 
If this is true, how does it handle over or underruns and how is it used correctly?

You can pass the input data as it becomes available.  Any incomplete instructions in the input data will be held in VCDiffDecoder's working memory until the next chunk is decoded.
OutputStringInterface assumes that the output type has synchronous append() and push_back() operations that can immediately accommodate new output data.  If you use an output type whose implementation writes to disk, then it is possible that append() or push_back() will block the thread waiting for the output buffer to be flushed.

Could someone shed some light on how this thing is to be used, since I can only find very little examples online

Please take a look at the sample command-line program in src/vcdiff_main.cc.
 
(is there maybe a better alternative?).

If open-vcdiff doesn't meet your needs, you can also look at xdelta (http://xdelta.org). 

Saludos,
Lincoln
Reply all
Reply to author
Forward
0 new messages