From eb51cb53545313e629d2bbfd240c2a3ff75e0502 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 23 Mar 2011 15:53:18 +0100 Subject: [PATCH] add sat_chksum_isfinished() check --- src/chksum.c | 7 +++++++ src/chksum.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/chksum.c b/src/chksum.c index 7f28d16..a070a86 100644 --- a/src/chksum.c +++ b/src/chksum.c @@ -127,6 +127,13 @@ sat_chksum_get_type(void *handle) return h->type; } +int +sat_chksum_isfinished(void *handle) +{ + struct ctxhandle *h = handle; + return h->done != 0; +} + const char * sat_chksum_type2str(Id type) { diff --git a/src/chksum.h b/src/chksum.h index 06fa64c..948a01a 100644 --- a/src/chksum.h +++ b/src/chksum.h @@ -4,6 +4,7 @@ void *sat_chksum_create(Id type); void *sat_chksum_create_from_bin(Id type, const unsigned char *buf); void sat_chksum_add(void *handle, const void *data, int len); Id sat_chksum_get_type(void *handle); +int sat_chksum_isfinished(void *handle); const unsigned char *sat_chksum_get(void *handle, int *lenp); void *sat_chksum_free(void *handle, unsigned char *cp); const char *sat_chksum_type2str(Id type); -- 2.7.4