diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-12-18 11:56:04 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-12-21 09:17:01 +0200 |
commit | 16726722c3c41e9a9f209b2b0a7ac3a0132d25ee (patch) | |
tree | 99640a472788f66fd0b8df48008495e728447af5 /lib | |
parent | 4e20d4c49f1d623458a7fdc28214e6729c4e32d4 (diff) | |
download | librpm-tizen-16726722c3c41e9a9f209b2b0a7ac3a0132d25ee.tar.gz librpm-tizen-16726722c3c41e9a9f209b2b0a7ac3a0132d25ee.tar.bz2 librpm-tizen-16726722c3c41e9a9f209b2b0a7ac3a0132d25ee.zip |
Move tsort data out of rpmte into, duh, tsortInfo
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rpmte.c | 36 | ||||
-rw-r--r-- | lib/rpmte_internal.h | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/lib/rpmte.c b/lib/rpmte.c index 9ffe44b57..9d59400e2 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -38,10 +38,6 @@ struct rpmte_s { rpmte depends; /*!< Package updated by this package (ERASE te) */ 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. */ unsigned int db_instance; /*!< Database instance (of removed pkgs) */ tsortInfo tsi; /*!< Dependency ordering chains. */ @@ -407,45 +403,45 @@ rpm_loff_t rpmtePkgFileSize(rpmte te) int rpmteDepth(rpmte te) { - return (te != NULL ? te->depth : 0); + return (te && te->tsi ? te->tsi->depth : 0); } int rpmteSetDepth(rpmte te, int ndepth) { int odepth = 0; - if (te != NULL) { - odepth = te->depth; - te->depth = ndepth; + if (te && te->tsi) { + odepth = te->tsi->depth; + te->tsi->depth = ndepth; } return odepth; } int rpmteNpreds(rpmte te) { - return (te != NULL ? te->npreds : 0); + return (te && te->tsi ? te->tsi->npreds : 0); } int rpmteSetNpreds(rpmte te, int npreds) { int opreds = 0; - if (te != NULL) { - opreds = te->npreds; - te->npreds = npreds; + if (te && te->tsi) { + opreds = te->tsi->npreds; + te->tsi->npreds = npreds; } return opreds; } int rpmteTree(rpmte te) { - return (te != NULL ? te->tree : 0); + return (te && te->tsi ? te->tsi->tree : 0); } int rpmteSetTree(rpmte te, int ntree) { int otree = 0; - if (te != NULL) { - otree = te->tree; - te->tree = ntree; + if (te && te->tsi) { + otree = te->tsi->tree; + te->tsi->tree = ntree; } return otree; } @@ -467,15 +463,15 @@ rpmte rpmteSetParent(rpmte te, rpmte pte) int rpmteDegree(rpmte te) { - return (te != NULL ? te->degree : 0); + return (te && te->tsi ? te->tsi->degree : 0); } int rpmteSetDegree(rpmte te, int ndegree) { int odegree = 0; - if (te != NULL) { - odegree = te->degree; - te->degree = ndegree; + if (te && te->tsi) { + odegree = te->tsi->degree; + te->tsi->degree = ndegree; } return odegree; } diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h index ed369585b..0d0774dd3 100644 --- a/lib/rpmte_internal.h +++ b/lib/rpmte_internal.h @@ -17,6 +17,10 @@ struct relation_s { typedef struct relation_s * relation; struct tsortInfo_s { + int degree; /*!< No. of immediate children. */ + int npreds; /*!< No. of predecessors. */ + int tree; /*!< Tree index. */ + int depth; /*!< Depth in dependency tree. */ int tsi_count; // #pkgs this pkg requires int tsi_qcnt; // #pkgs requiring this package int tsi_reqx; // requires Idx/mark as (queued/loop) |