70 int inbuflen,
int outbuflen)
78 outbuflen = rs_outbuflen ? rs_outbuflen : outbuflen;
80 in_fb = rs_filebuf_new(in_file, inbuflen);
82 out_fb = rs_filebuf_new(out_file, outbuflen);
84 rs_job_drive(job, &buf, in_fb ? rs_infilebuf_fill : NULL, in_fb,
85 out_fb ? rs_outfilebuf_drain : NULL, out_fb);
87 rs_filebuf_free(in_fb);
89 rs_filebuf_free(out_fb);
100 job =
rs_sig_begin(new_block_len, strong_len, sig_magic);
102 r = rs_whole_run(job, old_file, sig_file, 4 * new_block_len,
103 12 + 4 * (4 + strong_len));
105 memcpy(stats, &job->
stats,
sizeof *stats);
119 rs_get_filesize(sig_file, &job->
sig_fsize);
121 r = rs_whole_run(job, sig_file, NULL, 1024 * 16, 0);
123 memcpy(stats, &job->
stats,
sizeof *stats);
137 r = rs_whole_run(job, new_file, delta_file, sig->
block_len,
140 memcpy(stats, &job->
stats,
sizeof *stats);
153 r = rs_whole_run(job, delta_file, new_file, 64 * 1024, 64 * 1024);
155 memcpy(stats, &job->
stats,
sizeof *stats);
Description of input and output buffers.
int block_len
The block length.
rs_result rs_delta_file(rs_signature_t *, FILE *new_file, FILE *delta_file, rs_stats_t *)
Generate a delta between a signature and a new file into a delta file.
rs_job_t * rs_sig_begin(size_t new_block_len, size_t strong_sum_len, rs_magic_number sig_magic)
Start generating a signature.
int rs_inbuflen
Buffer sizes for file IO.
rs_result rs_loadsig_file(FILE *sig_file, rs_signature_t **sumset, rs_stats_t *stats)
Load signatures from a signature file into memory.
rs_stats_t stats
Encoding statistics.
rs_long_t sig_fsize
The size of the signature file if available.
Public header for librsync.
Signature of a whole file.
rs_result rs_sig_file(FILE *old_file, FILE *sig_file, size_t block_len, size_t strong_len, rs_magic_number sig_magic, rs_stats_t *stats)
Generate the signature of a basis file, and write it out to another.
Performance statistics from a librsync encoding or decoding operation.
rs_job_t * rs_delta_begin(rs_signature_t *sig)
Prepare to compute a streaming delta.
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.
rs_result
Return codes from nonblocking rsync operations.
rs_result rs_patch_file(FILE *basis_file, FILE *delta_file, FILE *new_file, rs_stats_t *)
Apply a patch, relative to a basis, into a new file.
rs_result rs_file_copy_cb(void *arg, rs_long_t pos, size_t *len, void **buf)
rs_copy_cb that reads from a stdio file.
rs_magic_number
A uint32 magic number, emitted in bigendian/network order at the start of librsync files...
rs_result rs_job_free(rs_job_t *job)
Deallocate job state.
rs_result rs_job_drive(rs_job_t *job, rs_buffers_t *buf, rs_driven_cb in_cb, void *in_opaque, rs_driven_cb out_cb, void *out_opaque)
Actively process a job, by making callbacks to fill and empty the buffers until the job is done...
rs_job_t * rs_loadsig_begin(rs_signature_t **)
Read a signature from a file into an rs_signature structure in memory.
of this structure are private.