summaryrefslogtreecommitdiff
path: root/lib/rpmps.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-12-04 11:25:46 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-12-04 11:25:46 +0200
commitdbdbe8010cd944f026a5a4e5d071eb31d29d81c4 (patch)
treeb7b0f4014409f8514a1729b48a8776660747d149 /lib/rpmps.c
parent422fa0dbeab879d3510c879554c33e359e0ab7ab (diff)
downloadrpm-dbdbe8010cd944f026a5a4e5d071eb31d29d81c4.tar.gz
Eliminate debug junk from the API
- add some helper macros to accomplish the same, easy to enable / disable as needed
Diffstat (limited to 'lib/rpmps.c')
-rw-r--r--lib/rpmps.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/rpmps.c b/lib/rpmps.c
index 133768bba..8f59ef0a4 100644
--- a/lib/rpmps.c
+++ b/lib/rpmps.c
@@ -39,21 +39,19 @@ struct rpmpsi_s {
int _rpmps_debug = 0;
-rpmps XrpmpsUnlink(rpmps ps, const char * msg,
- const char * fn, unsigned ln)
+rpmps rpmpsUnlink(rpmps ps, const char * msg)
{
if (_rpmps_debug > 0 && msg != NULL)
-fprintf(stderr, "--> ps %p -- %d %s at %s:%u\n", ps, ps->nrefs, msg, fn, ln);
+fprintf(stderr, "--> ps %p -- %d %s\n", ps, ps->nrefs, msg);
ps->nrefs--;
return ps;
}
-rpmps XrpmpsLink(rpmps ps, const char * msg,
- const char * fn, unsigned ln)
+rpmps rpmpsLink(rpmps ps, const char * msg)
{
ps->nrefs++;
if (_rpmps_debug > 0 && msg != NULL)
-fprintf(stderr, "--> ps %p ++ %d %s at %s:%u\n", ps, ps->nrefs, msg, fn, ln);
+fprintf(stderr, "--> ps %p ++ %d %s\n", ps, ps->nrefs, msg);
return ps;
}
@@ -70,7 +68,7 @@ rpmpsi rpmpsInitIterator(rpmps ps)
rpmpsi psi = NULL;
if (ps != NULL) {
psi = xcalloc(1, sizeof(*psi));
- psi->ps = rpmpsLink(ps, "iter ref");
+ psi->ps = rpmpsLink(ps, RPMDBG_M("rpmpsInitIterator"));
psi->ix = -1;
}
return psi;
@@ -79,7 +77,7 @@ rpmpsi rpmpsInitIterator(rpmps ps)
rpmpsi rpmpsFreeIterator(rpmpsi psi)
{
if (psi != NULL) {
- rpmpsUnlink(psi->ps, "iter unref");
+ rpmpsUnlink(psi->ps, RPMDBG_M("rpmpsFreeIterator"));
free(psi);
psi = NULL;
}
@@ -112,13 +110,13 @@ rpmProblem rpmpsGetProblem(rpmpsi psi)
rpmps rpmpsCreate(void)
{
rpmps ps = xcalloc(1, sizeof(*ps));
- return rpmpsLink(ps, "create");
+ return rpmpsLink(ps, RPMDBG_M("rpmpsCreate"));
}
rpmps rpmpsFree(rpmps ps)
{
if (ps == NULL) return NULL;
- ps = rpmpsUnlink(ps, "dereference");
+ ps = rpmpsUnlink(ps, RPMDBG_M("rpmpsFree"));
if (ps->nrefs > 0)
return NULL;