Eliminate last remaining FD_t struct privacy violation
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 14 Oct 2009 14:14:38 +0000 (17:14 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 14 Oct 2009 14:14:38 +0000 (17:14 +0300)
- add getter for fd digest bundle, uninline the setter

lib/package.c
rpmio/rpmio.c
rpmio/rpmio_internal.h

index 3bb53e7..d1c73bd 100644 (file)
@@ -15,7 +15,7 @@
 #include "lib/rpmlead.h"
 #include "lib/signature.h"
 #include "rpmio/digest.h"
-#include "rpmio/rpmio_internal.h"      /* fd*Digest(), fd stats */
+#include "rpmio/rpmio_internal.h"      /* fd digest bits */
 #include "lib/header_internal.h"       /* XXX headerCheck */
 
 #include "debug.h"
@@ -689,7 +689,7 @@ static rpmRC rpmpkgRead(rpmKeyring keyring, rpmVSFlags vsflags,
            goto exit;
        }
 
-       ctx = rpmDigestBundleDupCtx(fd->digests, (sigtag == RPMSIGTAG_MD5) ?
+       ctx = rpmDigestBundleDupCtx(fdGetBundle(fd), (sigtag == RPMSIGTAG_MD5) ?
                                    PGPHASHALGO_MD5 : dig->signature.hash_algo);
        break;
     default:
index 2e3e4ec..93253ee 100644 (file)
@@ -94,6 +94,18 @@ static FD_t c2f(void * cookie)
     return fd;
 }
 
+void fdSetBundle(FD_t fd, rpmDigestBundle bundle)
+{
+    FDSANE(fd);
+    fd->digests = bundle;
+}
+
+rpmDigestBundle fdGetBundle(FD_t fd)
+{
+    FDSANE(fd);
+    return fd->digests;
+}
+
 #define FDNREFS(fd)    (fd ? ((FD_t)fd)->nrefs : -9)
 #define FDTO(fd)       (fd ? ((FD_t)fd)->rd_timeoutsecs : -99)
 
index 313f968..31455fb 100644 (file)
@@ -59,12 +59,8 @@ struct _FD_s {
 extern "C" {
 #endif
 
-static inline
-void fdSetBundle(FD_t fd, rpmDigestBundle bundle)
-{
-    FDSANE(fd);
-    fd->digests = bundle;
-}
+void fdSetBundle(FD_t fd, rpmDigestBundle bundle);
+rpmDigestBundle fdGetBundle(FD_t fd);
 
 /** \ingroup rpmio
  * Attach digest to fd.