summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-26 08:34:40 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-26 08:34:40 +0300
commit1bbf25b78f31e93b7e54d7739f13285b99c907c2 (patch)
tree2bad53ca61a35bfe7f7eeadc5bd533e784760a7b /rpmio
parent824fd200b014b3b680fe6b01fc271a68fedd103e (diff)
downloadrpm-1bbf25b78f31e93b7e54d7739f13285b99c907c2.tar.gz
rpm-1bbf25b78f31e93b7e54d7739f13285b99c907c2.tar.bz2
rpm-1bbf25b78f31e93b7e54d7739f13285b99c907c2.zip
Add function to get number of unique strings in the pool
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmstrpool.c5
-rw-r--r--rpmio/rpmstrpool.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/rpmio/rpmstrpool.c b/rpmio/rpmstrpool.c
index 0a9e9b9a7..6adab0beb 100644
--- a/rpmio/rpmstrpool.c
+++ b/rpmio/rpmstrpool.c
@@ -396,3 +396,8 @@ int rpmstrPoolStreq(rpmstrPool poolA, rpmsid sidA,
else
return rstreq(rpmstrPoolStr(poolA, sidA), rpmstrPoolStr(poolB, sidB));
}
+
+rpmsid rpmstrPoolNumStr(rpmstrPool pool)
+{
+ return (pool != NULL) ? pool->offs_size : 0;
+}
diff --git a/rpmio/rpmstrpool.h b/rpmio/rpmstrpool.h
index 5794032a1..4089dc3c6 100644
--- a/rpmio/rpmstrpool.h
+++ b/rpmio/rpmstrpool.h
@@ -40,6 +40,9 @@ size_t rpmstrPoolStrlen(rpmstrPool pool, rpmsid sid);
int rpmstrPoolStreq(rpmstrPool poolA, rpmsid sidA,
rpmstrPool poolB, rpmsid sidB);
+/* get number of unique strings in pool */
+rpmsid rpmstrPoolNumStr(rpmstrPool pool);
+
#ifdef __cplusplus
}
#endif