librsync  2.3.4
Functions
patch.c File Reference

Apply a delta to an old file to generate a new file. More...

Include dependency graph for patch.c:

Go to the source code of this file.

Functions

static rs_result rs_patch_s_cmdbyte (rs_job_t *job)
 State of trying to read the first byte of a command. More...
 
static rs_result rs_patch_s_params (rs_job_t *job)
 Called after reading a command byte to pull in its parameters and then setup to execute the command. More...
 
static rs_result rs_patch_s_run (rs_job_t *job)
 Called when we've read in the whole command and we need to execute it. More...
 
static rs_result rs_patch_s_literal (rs_job_t *job)
 Called when trying to copy through literal data. More...
 
static rs_result rs_patch_s_copy (rs_job_t *)
 
static rs_result rs_patch_s_copying (rs_job_t *job)
 Called when we're executing a COPY command and waiting for all the data to be retrieved from the callback. More...
 
static rs_result rs_patch_s_header (rs_job_t *job)
 Called while we're trying to read the header of the patch. More...
 
rs_job_trs_patch_begin (rs_copy_cb *copy_cb, void *copy_arg)
 Apply a delta to a basis file to recreate the new file. More...
 

Detailed Description

Apply a delta to an old file to generate a new file.

Definition in file patch.c.

Function Documentation

◆ rs_patch_s_cmdbyte()

static rs_result rs_patch_s_cmdbyte ( rs_job_t job)
static

State of trying to read the first byte of a command.

Once we've taken that in, we can know how much data to read to get the arguments.

Definition at line 51 of file patch.c.

◆ rs_patch_s_params()

static rs_result rs_patch_s_params ( rs_job_t job)
static

Called after reading a command byte to pull in its parameters and then setup to execute the command.

Definition at line 71 of file patch.c.

◆ rs_patch_s_run()

static rs_result rs_patch_s_run ( rs_job_t job)
static

Called when we've read in the whole command and we need to execute it.

Definition at line 94 of file patch.c.

◆ rs_patch_s_literal()

static rs_result rs_patch_s_literal ( rs_job_t job)
static

Called when trying to copy through literal data.

Definition at line 114 of file patch.c.

◆ rs_patch_s_copy()

static rs_result rs_patch_s_copy ( rs_job_t job)
static

Definition at line 132 of file patch.c.

◆ rs_patch_s_copying()

static rs_result rs_patch_s_copying ( rs_job_t job)
static

Called when we're executing a COPY command and waiting for all the data to be retrieved from the callback.

Definition at line 158 of file patch.c.

◆ rs_patch_s_header()

static rs_result rs_patch_s_header ( rs_job_t job)
static

Called while we're trying to read the header of the patch.

Definition at line 204 of file patch.c.

◆ rs_patch_begin()

rs_job_t * rs_patch_begin ( rs_copy_cb copy_cb,
void *  copy_arg 
)

Apply a delta to a basis file to recreate the new file.

This gives you back a rs_job_t object, which can be cranked by calling rs_job_iter() and updating the stream pointers. When finished, call rs_job_free() to dispose of it.

Parameters
copy_cbCallback used to retrieve content from the basis file.
copy_argOpaque environment pointer passed through to the callback.
Todo:
As output is produced, accumulate the MD4 checksum of the output. Then if we find a CHECKSUM command we can check it's contents against the output.
Todo:
Implement COPY commands.
See also
rs_patch_file()
Streaming API

Definition at line 221 of file patch.c.