summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-13 13:08:33 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-13 13:08:33 +0300
commit92c12d1a8ef11106df69b07ca357c560e07e9efd (patch)
tree6867bea60ddb7de9799fea10acfd791f7a955c32 /lib
parente82ab8f81dcbfb94d94d4a5c8cb7813919d7f460 (diff)
downloadrpm-92c12d1a8ef11106df69b07ca357c560e07e9efd.tar.gz
rpm-92c12d1a8ef11106df69b07ca357c560e07e9efd.tar.bz2
rpm-92c12d1a8ef11106df69b07ca357c560e07e9efd.zip
Eliminate all fooUnlink() functions out of the API
- These are internal helpers only, all refcount users need to use fooFree() or similar for correct operation. Add fwd declarations where necessary to avoid moving code around unnecessarily. - We could add these back later as aliases to fooFree() but for now, just get them out of the way.
Diffstat (limited to 'lib')
-rw-r--r--lib/header.c2
-rw-r--r--lib/header.h7
-rw-r--r--lib/rpmdb.c3
-rw-r--r--lib/rpmdb.h7
-rw-r--r--lib/rpmds.c2
-rw-r--r--lib/rpmds.h7
-rw-r--r--lib/rpmfi.c2
-rw-r--r--lib/rpmfi.h7
-rw-r--r--lib/rpmprob.c4
-rw-r--r--lib/rpmprob.h7
-rw-r--r--lib/rpmps.c2
-rw-r--r--lib/rpmps.h7
-rw-r--r--lib/rpmts.c2
-rw-r--r--lib/rpmts.h7
14 files changed, 10 insertions, 56 deletions
diff --git a/lib/header.c b/lib/header.c
index d0983c10e..aaa2a9808 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -126,7 +126,7 @@ Header headerLink(Header h)
return h;
}
-Header headerUnlink(Header h)
+static Header headerUnlink(Header h)
{
if (h != NULL)
h->nrefs--;
diff --git a/lib/header.h b/lib/header.h
index c36255588..e038184ad 100644
--- a/lib/header.h
+++ b/lib/header.h
@@ -55,13 +55,6 @@ Header headerFree( Header h);
Header headerLink(Header h);
/** \ingroup header
- * Dereference a header instance.
- * @param h header
- * @return new header reference
- */
-Header headerUnlink(Header h);
-
-/** \ingroup header
* Sort tags in header.
* @param h header
*/
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index e7d7f4d43..41ee92c70 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -75,6 +75,7 @@ typedef struct _dbiIndexSet {
} * dbiIndexSet;
static unsigned int pkgInstance(dbiIndex dbi, int new);
+static rpmdb rpmdbUnlink(rpmdb db);
/* Bit mask macros. */
typedef unsigned int __pbm_bits;
@@ -732,7 +733,7 @@ static int openDatabase(const char * prefix,
return rc;
}
-rpmdb rpmdbUnlink(rpmdb db)
+static rpmdb rpmdbUnlink(rpmdb db)
{
if (db)
db->nrefs--;
diff --git a/lib/rpmdb.h b/lib/rpmdb.h
index 8a5f13185..c130a4222 100644
--- a/lib/rpmdb.h
+++ b/lib/rpmdb.h
@@ -39,13 +39,6 @@ typedef enum rpmdbOpX_e {
rpmop rpmdbOp(rpmdb db, rpmdbOpX opx);
/** \ingroup rpmdb
- * Unreference a database instance.
- * @param db rpm database
- * @return NULL always
- */
-rpmdb rpmdbUnlink(rpmdb db);
-
-/** \ingroup rpmdb
* Reference a database instance.
* @param db rpm database
* @return new rpm database reference
diff --git a/lib/rpmds.c b/lib/rpmds.c
index d18303824..c355300a6 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -74,7 +74,7 @@ static int dsType(rpmTag tag,
return rc;
}
-rpmds rpmdsUnlink(rpmds ds)
+static rpmds rpmdsUnlink(rpmds ds)
{
if (ds)
ds->nrefs--;
diff --git a/lib/rpmds.h b/lib/rpmds.h
index 7525020c5..b093224f9 100644
--- a/lib/rpmds.h
+++ b/lib/rpmds.h
@@ -81,13 +81,6 @@ typedef enum rpmsenseFlags_e {
#define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
/** \ingroup rpmds
- * Unreference a dependency set instance.
- * @param ds dependency set
- * @return NULL always
- */
-rpmds rpmdsUnlink(rpmds ds);
-
-/** \ingroup rpmds
* Reference a dependency set instance.
* @param ds dependency set
* @return new dependency set reference
diff --git a/lib/rpmfi.c b/lib/rpmfi.c
index 6ffcafb8e..d1c69c5b1 100644
--- a/lib/rpmfi.c
+++ b/lib/rpmfi.c
@@ -86,7 +86,7 @@ static strcache strcacheFree(strcache cache)
return NULL;
}
-rpmfi rpmfiUnlink(rpmfi fi)
+static rpmfi rpmfiUnlink(rpmfi fi)
{
if (fi)
fi->nrefs--;
diff --git a/lib/rpmfi.h b/lib/rpmfi.h
index d4123d0ef..84f6da80a 100644
--- a/lib/rpmfi.h
+++ b/lib/rpmfi.h
@@ -94,13 +94,6 @@ struct rpmRelocation_s {
};
/** \ingroup rpmfi
- * Unreference a file info set instance.
- * @param fi file info set
- * @return NULL always
- */
-rpmfi rpmfiUnlink (rpmfi fi);
-
-/** \ingroup rpmfi
* Reference a file info set instance.
* @param fi file info set
* @return new file info set reference
diff --git a/lib/rpmprob.c b/lib/rpmprob.c
index b22ecb371..df9c5782a 100644
--- a/lib/rpmprob.c
+++ b/lib/rpmprob.c
@@ -22,6 +22,8 @@ struct rpmProblem_s {
int nrefs;
};
+static rpmProblem rpmProblemUnlink(rpmProblem prob);
+
rpmProblem rpmProblemCreate(rpmProblemType type,
const char * pkgNEVR, fnpyKey key,
const char * altNEVR,
@@ -62,7 +64,7 @@ rpmProblem rpmProblemLink(rpmProblem prob)
return prob;
}
-rpmProblem rpmProblemUnlink(rpmProblem prob)
+static rpmProblem rpmProblemUnlink(rpmProblem prob)
{
if (prob) {
prob->nrefs--;
diff --git a/lib/rpmprob.h b/lib/rpmprob.h
index 296877e68..5ca5d1124 100644
--- a/lib/rpmprob.h
+++ b/lib/rpmprob.h
@@ -79,13 +79,6 @@ rpmProblem rpmProblemFree(rpmProblem prob);
rpmProblem rpmProblemLink(rpmProblem prob);
/** \ingroup rpmprob
- * Unreference an rpmProblem instance
- * @param prob rpm problem
- * @return rpm problem
- */
-rpmProblem rpmProblemUnlink(rpmProblem prob);
-
-/** \ingroup rpmprob
* Compare two problems for equality.
* @param ap 1st problem
* @param bp 2nd problem
diff --git a/lib/rpmps.c b/lib/rpmps.c
index e7a0bf0ed..6e1ab182c 100644
--- a/lib/rpmps.c
+++ b/lib/rpmps.c
@@ -25,7 +25,7 @@ struct rpmpsi_s {
};
-rpmps rpmpsUnlink(rpmps ps)
+static rpmps rpmpsUnlink(rpmps ps)
{
if (ps) {
ps->nrefs--;
diff --git a/lib/rpmps.h b/lib/rpmps.h
index 4b1050b7d..1b1142bf2 100644
--- a/lib/rpmps.h
+++ b/lib/rpmps.h
@@ -20,13 +20,6 @@ extern "C" {
typedef struct rpmpsi_s * rpmpsi;
/** \ingroup rpmps
- * Unreference a problem set instance.
- * @param ps problem set
- * @return problem set
- */
-rpmps rpmpsUnlink (rpmps ps);
-
-/** \ingroup rpmps
* Reference a problem set instance.
* @param ps transaction set
* @return new transaction set reference
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 855e376b2..1bf58e91d 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -42,7 +42,7 @@ static void loadKeyring(rpmts ts);
int _rpmts_stats = 0;
-rpmts rpmtsUnlink(rpmts ts)
+static rpmts rpmtsUnlink(rpmts ts)
{
if (ts)
ts->nrefs--;
diff --git a/lib/rpmts.h b/lib/rpmts.h
index 04fc9d17b..e03a70469 100644
--- a/lib/rpmts.h
+++ b/lib/rpmts.h
@@ -196,13 +196,6 @@ int rpmtsOrder(rpmts ts);
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
/** \ingroup rpmts
- * Unreference a transaction instance.
- * @param ts transaction set
- * @return NULL always
- */
-rpmts rpmtsUnlink (rpmts ts);
-
-/** \ingroup rpmts
* Reference a transaction set instance.
* @param ts transaction set
* @return new transaction set reference