From 0bc24859aeca6a4e0d34f05b60b27250b1253ddd Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 12 Sep 2019 18:01:14 +0200 Subject: Changed subscription id to rid --- common/subscriptions.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'common/subscriptions.c') 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); } -- cgit v1.2.3