blob: e6f47711a53c9230e3d973f1e311a430e1319808 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#ifndef COMMON_SUBSCRIPTIONS_H_
#define COMMON_SUBSCRIPTIONS_H_
#include <uthash.h>
enum subscription_type {
SUBSCRIPTION_CHANNEL,
SUBSCRIPTION_DIRECT,
SUBSCRIPTION_PRIVATE,
};
struct subscription {
char* rid;
char* name;
enum subscription_type type;
size_t unread;
UT_hash_handle hh;
};
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* 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
|