Split rpmte internals to separate header
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 3 Dec 2007 08:15:46 +0000 (10:15 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 3 Dec 2007 08:15:46 +0000 (10:15 +0200)
- avoid unnecessary include-order issues
- stop define-games for internals access

build/files.c
lib/Makefile.am
lib/depends.c
lib/psm.c
lib/rpmfi.c
lib/rpmte.c
lib/rpmte.h
lib/rpmte_internal.h [new file with mode: 0644]
lib/transaction.c

index 1ca5f95..b9fe840 100644 (file)
 #include <rpmfc.h>
 
 #include "lib/rpmfi_internal.h"        /* XXX pretty much all rpmfi internals... */
-#include <rpmfi.h>
-
-#define        _RPMTE_INTERNAL         /* XXX rpmte init */
-#include <rpmte.h>
+#include "lib/rpmte_internal.h"        /* XXX rpmte init */
 
 #include "build/buildio.h"
 
index ba21e89..5837216 100644 (file)
@@ -22,7 +22,8 @@ librpm_la_SOURCES = \
        poptALL.c poptI.c poptQV.c psm.c psm.h query.c \
        rpmal.c rpmchecksig.c rpmds.c rpmfi.c rpmfi_internal.h rpmgi.c \
        rpminstall.c rpmtsscore.h rpmts_internal.h \
-       rpmlead.c rpmlead.h rpmlibprov.c rpmps.c rpmrc.c rpmte.c rpmts.c \
+       rpmlead.c rpmlead.h rpmlibprov.c rpmps.c rpmrc.c \
+       rpmte.c rpmte_internal.h rpmts.c \
        rpmvercmp.c signature.c signature.h transaction.c \
        verify.c rpmlock.c rpmlock.h misc.h \
        legacy.c legacy.h
index 0cabb7d..cb5300b 100644 (file)
@@ -15,9 +15,7 @@
 #include <rpmds.h>
 #include <rpmfi.h>
 
-#define        _RPMTE_INTERNAL         /* XXX tsortInfo_s */
-#include <rpmte.h>
-
+#include "lib/rpmte_internal.h"                /* XXX tsortInfo_s */
 #include "lib/rpmts_internal.h"
 
 #include "debug.h"
index dbf8567..8914c21 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -18,8 +18,7 @@
 
 #include "lib/rpmfi_internal.h" /* XXX replaced/states, fi->hge, fi->te... */
 
-#define        _RPMTE_INTERNAL         /* XXX te->fd */
-#include <rpmte.h>
+#include "lib/rpmte_internal.h"        /* XXX te->fd */
 
 #include "lib/rpmtsscore.h"
 #include <rpmts.h>
index 1791dc5..cb35aad 100644 (file)
@@ -15,8 +15,7 @@
 
 #include "lib/rpmfi_internal.h"
 
-#define        _RPMTE_INTERNAL /* relocations */
-#include <rpmte.h>
+#include "lib/rpmte_internal.h"        /* relocations */
 #include <rpmts.h>
 
 #include <rpmfileutil.h>/* XXX domd5 */
index 18544dd..4336b97 100644 (file)
@@ -8,8 +8,7 @@
 #include <rpmds.h>
 #include <rpmfi.h>
 
-#define        _RPMTE_INTERNAL
-#include <rpmte.h>
+#include "lib/rpmte_internal.h"
 #include <rpmts.h>
 
 #include "debug.h"
index d273214..11406dd 100644 (file)
@@ -34,89 +34,6 @@ typedef enum rpmElementType_e {
     TR_REMOVED         = (1 << 1)      /*!< Package will be removed. */
 } rpmElementType;
 
-#if    defined(_RPMTE_INTERNAL)
-/** \ingroup rpmte
- * Dependncy ordering information.
- */
-struct tsortInfo_s {
-    union {
-       int     count;
-       rpmte   suc;
-    } tsi_u;
-#define        tsi_count       tsi_u.count
-#define        tsi_suc         tsi_u.suc
-    struct tsortInfo_s * tsi_next;
-    rpmte tsi_chain;
-    int                tsi_reqx;
-    int                tsi_qcnt;
-};
-
-/** \ingroup rpmte
- * A single package instance to be installed/removed atomically.
- */
-struct rpmte_s {
-    rpmElementType type;       /*!< Package disposition (installed/removed). */
-
-    Header h;                  /*!< Package header. */
-    const char * NEVR;         /*!< Package name-version-release. */
-    const char * NEVRA;                /*!< Package name-version-release.arch. */
-    const char * name;         /*!< Name: */
-    char * epoch;
-    char * version;            /*!< Version: */
-    char * release;            /*!< Release: */
-    const char * arch;         /*!< Architecture hint. */
-    const char * os;           /*!< Operating system hint. */
-    int archScore;             /*!< (TR_ADDED) Arch score. */
-    int osScore;               /*!< (TR_ADDED) Os score. */
-    int isSource;              /*!< (TR_ADDED) source rpm? */
-
-    rpmte parent;              /*!< Parent transaction element. */
-    int degree;                        /*!< No. of immediate children. */
-    int npreds;                        /*!< No. of predecessors. */
-    int tree;                  /*!< Tree index. */
-    int depth;                 /*!< Depth in dependency tree. */
-    int breadth;               /*!< Breadth in dependency tree. */
-    unsigned int db_instance;   /*!< Database Instance after add */
-    tsortInfo tsi;             /*!< Dependency ordering chains. */
-
-    rpmds this;                        /*!< This package's provided NEVR. */
-    rpmds provides;            /*!< Provides: dependencies. */
-    rpmds requires;            /*!< Requires: dependencies. */
-    rpmds conflicts;           /*!< Conflicts: dependencies. */
-    rpmds obsoletes;           /*!< Obsoletes: dependencies. */
-    rpmfi fi;                  /*!< File information. */
-
-    uint32_t color;            /*!< Color bit(s) from package dependencies. */
-    uint32_t pkgFileSize;      /*!< No. of bytes in package file (approx). */
-
-    fnpyKey key;               /*!< (TR_ADDED) Retrieval key. */
-    rpmRelocation * relocs;    /*!< (TR_ADDED) Payload file relocations. */
-    int nrelocs;               /*!< (TR_ADDED) No. of relocations. */
-    int autorelocatex;         /*!< (TR_ADDED) Auto relocation entry index. */
-    FD_t fd;                   /*!< (TR_ADDED) Payload file descriptor. */
-
-    union {
-       rpmalKey addedKey;
-       struct {
-           rpmalKey dependsOnKey;
-           int dboffset;
-       } removed;
-    } u;
-
-};
-
-/**
- * Iterator across transaction elements, forward on install, backward on erase.
- */
-struct rpmtsi_s {
-    rpmts ts;          /*!< transaction set. */
-    int reverse;       /*!< reversed traversal? */
-    int ocsave;                /*!< last returned iterator index. */
-    int oc;            /*!< iterator index. */
-};
-
-#endif /* _RPMTE_INTERNAL */
-
 /** \ingroup rpmte
  * Destroy a transaction element.
  * @param te           transaction element
diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h
new file mode 100644 (file)
index 0000000..4d5c9e6
--- /dev/null
@@ -0,0 +1,87 @@
+#ifndef        _RPMTE_INTERNAL_H
+#define _RPMTE_INTERNAL_H
+
+#include <rpmte.h>
+
+/** \ingroup rpmte
+ * Dependncy ordering information.
+ */
+struct tsortInfo_s {
+    union {
+       int     count;
+       rpmte   suc;
+    } tsi_u;
+#define        tsi_count       tsi_u.count
+#define        tsi_suc         tsi_u.suc
+    struct tsortInfo_s * tsi_next;
+    rpmte tsi_chain;
+    int                tsi_reqx;
+    int                tsi_qcnt;
+};
+
+/** \ingroup rpmte
+ * A single package instance to be installed/removed atomically.
+ */
+struct rpmte_s {
+    rpmElementType type;       /*!< Package disposition (installed/removed). */
+
+    Header h;                  /*!< Package header. */
+    const char * NEVR;         /*!< Package name-version-release. */
+    const char * NEVRA;                /*!< Package name-version-release.arch. */
+    const char * name;         /*!< Name: */
+    char * epoch;
+    char * version;            /*!< Version: */
+    char * release;            /*!< Release: */
+    const char * arch;         /*!< Architecture hint. */
+    const char * os;           /*!< Operating system hint. */
+    int archScore;             /*!< (TR_ADDED) Arch score. */
+    int osScore;               /*!< (TR_ADDED) Os score. */
+    int isSource;              /*!< (TR_ADDED) source rpm? */
+
+    rpmte parent;              /*!< Parent transaction element. */
+    int degree;                        /*!< No. of immediate children. */
+    int npreds;                        /*!< No. of predecessors. */
+    int tree;                  /*!< Tree index. */
+    int depth;                 /*!< Depth in dependency tree. */
+    int breadth;               /*!< Breadth in dependency tree. */
+    unsigned int db_instance;   /*!< Database Instance after add */
+    tsortInfo tsi;             /*!< Dependency ordering chains. */
+
+    rpmds this;                        /*!< This package's provided NEVR. */
+    rpmds provides;            /*!< Provides: dependencies. */
+    rpmds requires;            /*!< Requires: dependencies. */
+    rpmds conflicts;           /*!< Conflicts: dependencies. */
+    rpmds obsoletes;           /*!< Obsoletes: dependencies. */
+    rpmfi fi;                  /*!< File information. */
+
+    uint32_t color;            /*!< Color bit(s) from package dependencies. */
+    uint32_t pkgFileSize;      /*!< No. of bytes in package file (approx). */
+
+    fnpyKey key;               /*!< (TR_ADDED) Retrieval key. */
+    rpmRelocation * relocs;    /*!< (TR_ADDED) Payload file relocations. */
+    int nrelocs;               /*!< (TR_ADDED) No. of relocations. */
+    int autorelocatex;         /*!< (TR_ADDED) Auto relocation entry index. */
+    FD_t fd;                   /*!< (TR_ADDED) Payload file descriptor. */
+
+    union {
+       rpmalKey addedKey;
+       struct {
+           rpmalKey dependsOnKey;
+           int dboffset;
+       } removed;
+    } u;
+
+};
+
+/**
+ * Iterator across transaction elements, forward on install, backward on erase.
+ */
+struct rpmtsi_s {
+    rpmts ts;          /*!< transaction set. */
+    int reverse;       /*!< reversed traversal? */
+    int ocsave;                /*!< last returned iterator index. */
+    int oc;            /*!< iterator index. */
+};
+
+#endif /* _RPMTE_INTERNAL_H */
+
index 5e7cbeb..f5a7553 100644 (file)
@@ -20,8 +20,7 @@
 
 #include "lib/rpmfi_internal.h"        /* fi->replaced, fi->actions... */
 
-#define        _RPMTE_INTERNAL         /* XXX te->h, te->fd, te->h */
-#include <rpmte.h>
+#include "lib/rpmte_internal.h"        /* XXX te->h, te->fd, te->h */
 
 #include "lib/rpmts_internal.h"