summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-11 13:53:24 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-11 13:53:24 +0300
commit0d17da2615efe3e7168000f57ddd285365dd7515 (patch)
tree476a4fe6e83e53d8403ed1a1e1da7f7c30949e6a /lib
parent2d62f297bc07682f221cc8d4c893fa72d32e342b (diff)
downloadrpm-0d17da2615efe3e7168000f57ddd285365dd7515.tar.gz
rpm-0d17da2615efe3e7168000f57ddd285365dd7515.tar.bz2
rpm-0d17da2615efe3e7168000f57ddd285365dd7515.zip
Add an alternative rpmds constructor to allow shared pool usage
- rpmdsNewPool() allows specifying shared/private pool, and rpmdsNew() is now just a wrapper to always call it with NULL (ie private) pool.
Diffstat (limited to 'lib')
-rw-r--r--lib/rpmds.c9
-rw-r--r--lib/rpmds.h11
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c
index c07f533e0..7e6582a09 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -162,7 +162,7 @@ static rpmds rpmdsCreate(rpmstrPool pool,
return rpmdsLink(ds);
}
-rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags)
+rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags)
{
rpmTagVal tagEVR, tagF;
rpmds ds = NULL;
@@ -174,7 +174,7 @@ rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags)
if (headerGet(h, tagN, &names, HEADERGET_MINMEM)) {
struct rpmtd_s evr, flags;
- ds = rpmdsCreate(NULL, tagN, Type,
+ ds = rpmdsCreate(pool, tagN, Type,
rpmtdCount(&names), headerGetInstance(h));
ds->N = rpmtdToPool(&names, ds->pool);
@@ -203,6 +203,11 @@ exit:
return ds;
}
+rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags)
+{
+ return rpmdsNewPool(NULL, h, tagN, flags);
+}
+
char * rpmdsNewDNEVR(const char * dspfx, const rpmds ds)
{
const char * N = rpmdsN(ds);
diff --git a/lib/rpmds.h b/lib/rpmds.h
index d096b672a..d0ec29245 100644
--- a/lib/rpmds.h
+++ b/lib/rpmds.h
@@ -98,6 +98,7 @@ rpmds rpmdsLink(rpmds ds);
* @return NULL always
*/
rpmds rpmdsFree(rpmds ds);
+
/** \ingroup rpmds
* Create and load a dependency set.
* @param h header
@@ -108,6 +109,16 @@ rpmds rpmdsFree(rpmds ds);
rpmds rpmdsNew(Header h, rpmTagVal tagN, int flags);
/** \ingroup rpmds
+ * Create and load a dependency set.
+ * @param pool shared string pool (or NULL for private pool)
+ * @param h header
+ * @param tagN type of dependency
+ * @param flags unused
+ * @return new dependency set
+ */
+rpmds rpmdsNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, int flags);
+
+/** \ingroup rpmds
* Return new formatted dependency string.
* @param dspfx formatted dependency string prefix
* @param ds dependency set