summaryrefslogtreecommitdiff
path: root/mksum.c
diff options
context:
space:
mode:
authorMartin Pool <mbp@sourcefrog.net>2000-05-22 08:56:47 +0000
committerMartin Pool <mbp@sourcefrog.net>2000-05-22 08:56:47 +0000
commit72e8318c582f5a821e4ef8bad23abd9c8b98b841 (patch)
tree2fbdcceef2e4574bec57a11e9a614ef11dc22d78 /mksum.c
parent162671e4bfa2abde24a9591ef6132e7ab7ad5cf8 (diff)
downloadlibrsync-72e8318c582f5a821e4ef8bad23abd9c8b98b841.tar.gz
Further implementation of the nad algorithm -- at the moment it
doesn't actually search, but it does do everything else, and it emits literal data correctly.
Diffstat (limited to 'mksum.c')
-rw-r--r--mksum.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mksum.c b/mksum.c
index 2bf3b70..bedc63a 100644
--- a/mksum.c
+++ b/mksum.c
@@ -56,11 +56,7 @@ hs_mksum_begin(int in_fd,
{
hs_mksum_job_t *job;
- job = malloc(sizeof *job);
- if (!job) {
- _hs_fatal("can't allocate space for hs_gd02_job");
- }
- hs_bzero(job, sizeof *job);
+ job = _hs_alloc_struct(hs_mksum_job_t);
job->in_fd = in_fd;
job->write_fn = write_fn;
@@ -94,7 +90,7 @@ _hs_mksum_finish(hs_mksum_job_t *job)
/*
* Generate and write out the checksums of a block.
*/
-static void
+void
_hs_mksum_of_block(char const *p, ssize_t len,
hs_write_fn_t write_fn, void *write_priv,
size_t strong_sum_len)
@@ -125,7 +121,7 @@ _hs_mksum_of_block(char const *p, ssize_t len,
* HS_AGAIN, HS_DONE or HS_FAILED. Unless it returns HS_AGAIN, then
* the job is closed on return.
*/
-hs_result_t hs_mksum(hs_mksum_job_t *job)
+hs_result_t hs_mksum_iter(hs_mksum_job_t *job)
{
int ret;
char const *p;