1 | // =============================================================== // |
---|
2 | // // |
---|
3 | // File : aw_inotify.hxx // |
---|
4 | // Purpose : watch file/directory changes // |
---|
5 | // // |
---|
6 | // Coded by Ralf Westram (coder@reallysoft.de) in October 2017 // |
---|
7 | // http://www.arb-home.de/ // |
---|
8 | // // |
---|
9 | // =============================================================== // |
---|
10 | |
---|
11 | #ifndef AW_INOTIFY_HXX |
---|
12 | #define AW_INOTIFY_HXX |
---|
13 | |
---|
14 | #ifndef CB_H |
---|
15 | #include <cb.h> |
---|
16 | #endif |
---|
17 | |
---|
18 | enum ChangeReason { |
---|
19 | CR_MODIFIED, |
---|
20 | CR_DELETED, // will be suppressed if the file still exists |
---|
21 | CR_CREATED, |
---|
22 | }; |
---|
23 | |
---|
24 | #define CHANGE_REASONS (CR_CREATED+1) |
---|
25 | |
---|
26 | DECLARE_CBTYPE_FFV_AND_BUILDERS(FileChangedCallback, void, const char*, ChangeReason); // generates makeFileChangedCallback |
---|
27 | |
---|
28 | void AW_add_inotification(const char *file, const FileChangedCallback& fccb); |
---|
29 | void AW_remove_inotification(const char *file, const FileChangedCallback& fccb); |
---|
30 | |
---|
31 | |
---|
32 | #else |
---|
33 | #error aw_inotify.hxx included twice |
---|
34 | #endif // AW_INOTIFY_HXX |
---|