summaryrefslogtreecommitdiff
path: root/doc/streaming.md
diff options
context:
space:
mode:
authorDonovan Baarda <abo@minkirri.apana.org.au>2020-05-13 14:35:36 +1000
committerDonovan Baarda <abo@minkirri.apana.org.au>2020-05-13 14:35:36 +1000
commit7dd34f6ecf9a549dfa636f3909861a1387a4ef65 (patch)
treeed23f3cbb026dcff1128da23f1d125911afafccc /doc/streaming.md
parentb35639e503deb42f527e1514d900726eeecef7ac (diff)
downloadlibrsync-7dd34f6ecf9a549dfa636f3909861a1387a4ef65.tar.gz
Update API docs to include rs_sig_args() and rs_build_hash_table().
Change the titles and refer to the api's as "Streaming API", "Callback API" and "Whole-file API". Add instructions about using rs_sig_args() and rs_build_hash_table(). Remove instructions about setting job->sig_file_bytes to pre-allocate the signature because this is not publicly exposed... the rs_job_t structure is not public.
Diffstat (limited to 'doc/streaming.md')
-rw-r--r--doc/streaming.md20
1 files changed, 11 insertions, 9 deletions
diff --git a/doc/streaming.md b/doc/streaming.md
index 3b2dd19..449ee13 100644
--- a/doc/streaming.md
+++ b/doc/streaming.md
@@ -1,4 +1,4 @@
-# Streaming jobs {#api_streaming}
+# Streaming API {#api_streaming}
A key design requirement for librsync is that it should handle data as
and when the hosting application requires it. librsync can be used
@@ -49,19 +49,22 @@ file.
- rs_patch_begin(): Apply a delta to a basis to recreate the new
file.
+Additionally, the following helper functions can be used to get the
+recommended signature arguments from the input file's size.
+
+- rs_sig_args(): Get the recommended sigature arguments from the file size.
+
+After a signature has been loaded, before it can be used to calculate a delta,
+the hashtable needs to be initialized by calling
+
+- rs_build_hash_table(): Initialized the signature hashtable.
+
The patch job accepts the patch as input, and uses a callback to look up
blocks within the basis file.
You must configure read, write and basis callbacks after creating the
job but before it is run.
-You can set job->sig_file_bytes to signature file size or
-job->estimated_signature_count before running the job
-if the signature file size (or the number of chunks) is known in advance.
-If both are set, estimated_signature_count is used.
-This will preallocate the needed memory for signature sums instead of
-calling realloc for each block.
-
## Running Jobs
@@ -92,7 +95,6 @@ rs_job_free() does not delete the output of the job, such as the sumset
loaded into memory. It does delete the job's statistics.
-
## State Machine Internals
Internally, the operations are implemented as state machines that move