blob: 6c10a24fb844fcc7158be06fc9006de8332fa60a (
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
27
28
|
#ifndef COMMON_SUBSCRIPTIONS_H_
#define COMMON_SUBSCRIPTIONS_H_
#include <uthash.h>
static const char *subscription_type_str[] = {
"channel", "direct", "private",
};
enum subscription_type {
SUBSCRIPTION_CHANNEL,
SUBSCRIPTION_DIRECT,
SUBSCRIPTION_PRIVATE,
};
struct subscription {
char* id;
char* name;
enum subscription_type type;
UT_hash_handle hh;
};
void common_subscription_add(struct subscription** subscriptions, const char* id, const char* name, enum subscription_type type);
struct subscription* common_subscription_new(const char* id, const char* name, enum subscription_type type);
void common_subscriptions_free(struct subscription* subscriptions);
void common_subscriptions_const_walk(const struct subscription* subscriptions, void (*func)(const struct subscription*));
#endif
|