1 # Whole-file API {#api_whole}
3 Some applications
do not require the fine-grained control over IO, but
4 rather just want to process a whole file with a single call.
5 librsync provides whole-file APIs to
do exactly that.
7 These functions open files, process the entire contents, and
return an
8 overall result. The whole-file operations are the core of the
11 Processing of a whole file begins with creation of
a ::rs_job_t
12 object for the appropriate operation, just as
if the application was
13 going to
do buffering itself. After creation, the job may be passed
14 to rs_whole_run(), which will feed it to and from two FILEs as
15 necessary until end of file is reached or the operation completes.
struct rs_job rs_job_t
Job of work to be done.
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_result rs_loadsig_file(FILE *sig_file, rs_signature_t **sumset, rs_stats_t *stats)
Load signatures from a signature file into memory.
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.
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.