annotate src/lib/ioloop-notify-fd.h @ 22656:1789bf2a1e01

director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0 The reset command would just hang in that case. doveadm would never have sent this, so this is just an extra sanity check.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 05 Nov 2017 23:51:56 +0200
parents c93ca5e46a8a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 5248
diff changeset
1 #ifndef IOLOOP_NOTIFY_FD_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 5248
diff changeset
2 #define IOLOOP_NOTIFY_FD_H
5248
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 /* common notify code for fd-based notifications (dnotify, inotify) */
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 struct io_notify {
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 struct io io;
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 /* use a doubly linked list so that io_remove() is quick */
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 struct io_notify *prev, *next;
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 int fd;
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 };
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 struct ioloop_notify_fd_context {
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 struct io_notify *notifies;
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17 };
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18
14629
c93ca5e46a8a Marked functions parameters that are allowed to be NULL. Some APIs were also changed.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
19 struct io *
c93ca5e46a8a Marked functions parameters that are allowed to be NULL. Some APIs were also changed.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
20 io_notify_fd_add(struct ioloop_notify_fd_context *ctx, int fd,
c93ca5e46a8a Marked functions parameters that are allowed to be NULL. Some APIs were also changed.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
21 io_callback_t *callback, void *context) ATTR_NULL(4);
5248
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22 void io_notify_fd_free(struct ioloop_notify_fd_context *ctx,
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 struct io_notify *io);
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25 struct io_notify *
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
26 io_notify_fd_find(struct ioloop_notify_fd_context *ctx, int fd);
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
27
12ac5f685814 Various cleanups to ioloop code.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28 #endif