Lines Matching refs:box
22 static void notify_delay_callback(struct mailbox *box)
24 timeout_remove(&box->to_notify_delay);
25 box->notify_callback(box, box->notify_context);
28 static void notify_timeout(struct mailbox *box)
34 for (file = box->notify_files; file != NULL; file = file->next) {
43 notify_delay_callback(box);
46 static void notify_callback(struct mailbox *box)
48 timeout_reset(box->to_notify);
50 if (box->to_notify_delay == NULL) {
51 box->to_notify_delay =
53 notify_delay_callback, box);
57 void mailbox_watch_add(struct mailbox *box, const char *path)
59 const struct mail_storage_settings *set = box->storage->set;
66 (void)io_add_notify(path, notify_callback, box, &io);
74 file->next = box->notify_files;
75 box->notify_files = file;
80 if (box->to_notify == NULL) {
81 box->to_notify =
83 notify_timeout, box);
87 void mailbox_watch_remove_all(struct mailbox *box)
91 while (box->notify_files != NULL) {
92 file = box->notify_files;
93 box->notify_files = file->next;
100 timeout_remove(&box->to_notify_delay);
101 timeout_remove(&box->to_notify);
104 static void notify_extract_callback(struct mailbox *box ATTR_UNUSED)
109 int mailbox_watch_extract_notify_fd(struct mailbox *box, const char **reason_r)
122 for (file = box->notify_files; file != NULL && !failed; file = file->next) {
123 switch (io_add_notify(file->path, notify_extract_callback, box, &io)) {