From fa0337c9b64d69b3a4e50d810ec63c7798cad6c6 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 14 Oct 2009 15:59:39 +0300 Subject: [PATCH] Move fdDigest*() to rpmio.c where they better belong --- lib/rpmchecksig.c | 1 + rpmio/digest.c | 30 ------------------------------ rpmio/digest.h | 1 - rpmio/rpmio.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index b8660e6..1b5fca4 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -16,6 +16,7 @@ #include #include "rpmio/digest.h" +#include "rpmio/rpmio_internal.h" /* fdSetBundle() */ #include "lib/rpmlead.h" #include "lib/signature.h" diff --git a/rpmio/digest.c b/rpmio/digest.c index 4803689..cc06fda 100644 --- a/rpmio/digest.c +++ b/rpmio/digest.c @@ -244,33 +244,3 @@ DPRINTF((stderr, "*** Final(%p,%p,%p,%zd) hashctx %p digest %p\n", ctx, datap, l return 0; } -void fdInitDigest(FD_t fd, pgpHashAlgo hashalgo, int flags) -{ - if (fd->digests == NULL) { - fd->digests = rpmDigestBundleNew(); - } - fdstat_enter(fd, FDSTAT_DIGEST); - rpmDigestBundleAdd(fd->digests, hashalgo, flags); - fdstat_exit(fd, FDSTAT_DIGEST, (ssize_t) 0); -} - -void fdUpdateDigests(FD_t fd, const unsigned char * buf, size_t buflen) -{ - if (fd && fd->digests) { - fdstat_enter(fd, FDSTAT_DIGEST); - rpmDigestBundleUpdate(fd->digests, buf, buflen); - fdstat_exit(fd, FDSTAT_DIGEST, (ssize_t) buflen); - } -} - -void fdFiniDigest(FD_t fd, pgpHashAlgo hashalgo, - void ** datap, - size_t * lenp, - int asAscii) -{ - if (fd && fd->digests) { - fdstat_enter(fd, FDSTAT_DIGEST); - rpmDigestBundleFinal(fd->digests, hashalgo, datap, lenp, asAscii); - fdstat_exit(fd, FDSTAT_DIGEST, (ssize_t) 0); - } -} diff --git a/rpmio/digest.h b/rpmio/digest.h index e934df8..0f44619 100644 --- a/rpmio/digest.h +++ b/rpmio/digest.h @@ -8,7 +8,6 @@ #include #include "rpmio/base64.h" -#include "rpmio/rpmio_internal.h" /** \ingroup rpmio diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 08b94c6..66035fb 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -2007,3 +2007,33 @@ static const struct FDIO_s fpio_s = { }; static const FDIO_t fpio = &fpio_s ; +void fdInitDigest(FD_t fd, pgpHashAlgo hashalgo, int flags) +{ + if (fd->digests == NULL) { + fd->digests = rpmDigestBundleNew(); + } + fdstat_enter(fd, FDSTAT_DIGEST); + rpmDigestBundleAdd(fd->digests, hashalgo, flags); + fdstat_exit(fd, FDSTAT_DIGEST, (ssize_t) 0); +} + +void fdUpdateDigests(FD_t fd, const unsigned char * buf, size_t buflen) +{ + if (fd && fd->digests) { + fdstat_enter(fd, FDSTAT_DIGEST); + rpmDigestBundleUpdate(fd->digests, buf, buflen); + fdstat_exit(fd, FDSTAT_DIGEST, (ssize_t) buflen); + } +} + +void fdFiniDigest(FD_t fd, pgpHashAlgo hashalgo, + void ** datap, + size_t * lenp, + int asAscii) +{ + if (fd && fd->digests) { + fdstat_enter(fd, FDSTAT_DIGEST); + rpmDigestBundleFinal(fd->digests, hashalgo, datap, lenp, asAscii); + fdstat_exit(fd, FDSTAT_DIGEST, (ssize_t) 0); + } +} -- 2.7.4