librsync  2.3.4
whole.md
1 # Whole-file API {#api_whole}
2 
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.
6 
7 These functions open files, process the entire contents, and return an overall
8 result. The whole-file operations are the core of the \ref page_rdiff.
9 
10 This interface is implemented on top of the \ref api_streaming. Processing of
11 a whole file begins with creation of a ::rs_job_t object for the appropriate
12 operation, just as if the application was going to do buffering itself. After
13 creation, the job may be passed to rs_whole_run(), which will feed it to and
14 from two FILEs as necessary until end of file is reached or the operation
15 completes.
16 
17 \see rs_sig_args()
18 \see rs_sig_file()
19 \see rs_loadsig_file()
20 \see rs_delta_file()
21 \see rs_patch_file()
LIBRSYNC_EXPORT 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.
Definition: whole.c:108
LIBRSYNC_EXPORT 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.
Definition: whole.c:124
LIBRSYNC_EXPORT rs_result rs_loadsig_file(FILE *sig_file, rs_signature_t **sumset, rs_stats_t *stats)
Load signatures from a signature file into memory.
Definition: whole.c:90
LIBRSYNC_EXPORT 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.
Definition: whole.c:67
LIBRSYNC_EXPORT rs_result rs_sig_args(rs_long_t old_fsize, rs_magic_number *magic, size_t *block_len, size_t *strong_len)
Get or check signature arguments for a given file size.
Definition: sumset.c:113
The contents of this structure are private.
Definition: job.h:47
rs_result rs_whole_run(rs_job_t *job, FILE *in_file, FILE *out_file, int inbuflen, int outbuflen)
Run a job continuously, with input to/from the two specified files.
Definition: whole.c:43