aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--common/subscriptions.c5
-rw-r--r--common/subscriptions.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/common/subscriptions.c b/common/subscriptions.c
index 9c8c345..529c339 100644
--- a/common/subscriptions.c
+++ b/common/subscriptions.c
@@ -38,3 +38,8 @@ void common_subscriptions_const_walk(const struct subscription* subscriptions, v
func(sub);
}
}
+
+size_t common_subscriptions_count(const struct subscription* subscriptions)
+{
+ return HASH_COUNT(subscriptions);
+}
diff --git a/common/subscriptions.h b/common/subscriptions.h
index 0ade221..3e195bb 100644
--- a/common/subscriptions.h
+++ b/common/subscriptions.h
@@ -25,5 +25,6 @@ void common_subscription_add(struct subscription** subscriptions, const char* id
struct subscription* common_subscription_new(const char* rid, const char* name, enum subscription_type type, size_t unread);
void common_subscriptions_free(struct subscription* subscriptions);
void common_subscriptions_const_walk(const struct subscription* subscriptions, void (*func)(const struct subscription*));
+size_t common_subscriptions_count(const struct subscription* subscriptions);
#endif