1 #ifndef CLIENT_H
2 #define CLIENT_H
3 
4 struct client {
5 	struct client *prev, *next;
6 
7 	int fd;
8 	struct io *io;
9 	struct istream *input;
10 	struct ostream *output;
11 	struct timeout *to_pending;
12 
13 	pool_t cmd_pool;
14 	struct client_export_cmd *cmd_export;
15 	int (*cmd_more)(struct client *client);
16 
17 	/* command iterators. while non-NULL, they've increased the
18 	   struct's refcount so it won't be deleted during iteration */
19 	unsigned int iter_count;
20 	struct mail_command *mail_cmd_iter;
21 	struct mail_session *mail_session_iter;
22 	struct mail_user *mail_user_iter;
23 	struct mail_domain *mail_domain_iter;
24 	struct mail_ip *mail_ip_iter;
25 };
26 
27 struct client *client_create(int fd);
28 void client_destroy(struct client **client);
29 
30 bool client_is_busy(struct client *client);
31 void client_enable_io(struct client *client);
32 
33 void clients_destroy_all(void);
34 
35 #endif
36