Monitor files for changes. More...
#include <stdbool.h>
Go to the source code of this file.
Functions | |
int | mutt_monitor_add (struct Mailbox *m) |
Add a watch for a mailbox. | |
int | mutt_monitor_remove (struct Mailbox *m) |
Remove a watch for a mailbox. | |
int | mutt_monitor_poll (void) |
Check for filesystem changes. | |
Variables | |
bool | MonitorFilesChanged |
true after a monitored file has changed | |
bool | MonitorCurMboxChanged |
true after the current mailbox has changed | |
Monitor files for changes.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file monitor.h.
int mutt_monitor_add | ( | struct Mailbox * | m | ) |
Add a watch for a mailbox.
m | Mailbox to watch |
0 | success: new or already existing monitor |
-1 | failed: no mailbox, inaccessible file, create monitor/watcher failed |
If m is NULL, try to get the current mailbox from the Index.
Definition at line 484 of file monitor.c.
int mutt_monitor_remove | ( | struct Mailbox * | m | ) |
Remove a watch for a mailbox.
m | Mailbox |
0 | monitor removed (not shared) |
1 | monitor not removed (shared) |
2 | no monitor |
If m is NULL, try to get the current mailbox from the Index.
Definition at line 528 of file monitor.c.
int mutt_monitor_poll | ( | void | ) |
Check for filesystem changes.
-3 | unknown/unexpected events: poll timeout / fds not handled by us |
-2 | monitor detected changes, no STDIN input |
-1 | error (see errno) |
0 | (1) input ready from STDIN, or (2) monitoring inactive -> no poll() |
Wait for I/O ready file descriptors or signals.
MonitorFilesChanged also reflects changes to monitored files.
Only STDIN and INotify file handles currently expected/supported. More would ask for common infrastructure (sockets?).
Definition at line 401 of file monitor.c.
|
extern |