aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--common/subscriptions.c14
-rw-r--r--common/subscriptions.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/common/subscriptions.c b/common/subscriptions.c
index 0874cb0..9c8c345 100644
--- a/common/subscriptions.c
+++ b/common/subscriptions.c
@@ -1,16 +1,16 @@
#include "subscriptions.h"
-void common_subscription_add(struct subscription** subscriptions, const char* id, const char* name, enum subscription_type type, size_t unread)
+void common_subscription_add(struct subscription** subscriptions, const char* rid, const char* name, enum subscription_type type, size_t unread)
{
- struct subscription * subscription = common_subscription_new(id, name, type, unread);
- HASH_ADD_KEYPTR(hh, *subscriptions, subscription->id, strlen(id), subscription);
+ struct subscription * subscription = common_subscription_new(rid, name, type, unread);
+ HASH_ADD_KEYPTR(hh, *subscriptions, subscription->rid, strlen(rid), subscription);
}
-struct subscription* common_subscription_new(const char* id, const char* name, enum subscription_type type, size_t unread)
+struct subscription* common_subscription_new(const char* rid, const char* name, enum subscription_type type, size_t unread)
{
struct subscription* subscription = malloc(sizeof(struct subscription));
- subscription->id = malloc(strlen(id) + 1);
- strcpy(subscription->id, id);
+ subscription->rid = malloc(strlen(rid) + 1);
+ strcpy(subscription->rid, rid);
subscription->name = malloc(strlen(name) + 1);
strcpy(subscription->name, name);
subscription->type = type;
@@ -24,7 +24,7 @@ void common_subscriptions_free(struct subscription* subscriptions)
HASH_ITER(hh, subscriptions, sub, tmp) {
HASH_DEL(subscriptions, sub);
- free(sub->id);
+ free(sub->rid);
free(sub->name);
free(sub);
}
diff --git a/common/subscriptions.h b/common/subscriptions.h
index a152345..0ade221 100644
--- a/common/subscriptions.h
+++ b/common/subscriptions.h
@@ -14,7 +14,7 @@ enum subscription_type {
};
struct subscription {
- char* id;
+ char* rid;
char* name;
enum subscription_type type;
size_t unread;
@@ -22,7 +22,7 @@ struct subscription {
};
void common_subscription_add(struct subscription** subscriptions, const char* id, const char* name, enum subscription_type type, size_t unread);
-struct subscription* common_subscription_new(const char* id, const char* name, enum subscription_type type, size_t unread);
+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*));