-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchannel.h
46 lines (37 loc) · 1.23 KB
/
channel.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef MBIDLED_CHANNEL_H
#define MBIDLED_CHANNEL_H
#include <ev.h>
#include <sys/queue.h>
struct mbconfig;
struct mbconfig_channel;
struct mbconfig_store;
struct channel_mailbox;
struct channel {
#ifdef EV_MULTIPLICITY
struct ev_loop *loop;
#endif
struct mbconfig *mb_config;
struct mbconfig_channel *mb_chan;
LIST_HEAD(, channel_mailbox) boxes;
};
void channel_open(EV_P_ struct mbconfig *mb_config, struct mbconfig_channel *mb_chan);
void
channel_notify_change(struct channel *chan, struct mbconfig_store *mb_store, char const *mailbox);
void imap_open_store(struct channel *chan, struct mbconfig_store *mb_store);
void maildir_open_store(struct channel *chan, struct mbconfig_store *mb_store);
void channel_log(struct channel *chan, int priority, char const *format, ...);
void channel_store_log(
struct channel const *chan, char const *store_name, char const *mailbox, int priority,
char const *format, va_list ap
);
#define DEFINE_CHANNEL_STORE_LOGGER(store, store_name) \
static void store##_log( \
struct store##_store const *store, int priority, char const *format, ... \
) \
{ \
va_list ap; \
va_start(ap, format); \
channel_store_log(store->chan, store_name, store->mailbox, priority, format, ap); \
va_end(ap); \
}
#endif