source: trunk/include/sh_inotify.h@ 372

Last change on this file since 372 was 372, checked in by katerina, 13 years ago

One more patch for ticket #265 (inotify). Handle dirs that are only specified as files.

File size: 1.5 KB
Line 
1#ifndef SH_INOTIFY_H
2#define SH_INOTIFY_H
3
4#define SH_INOTIFY_MAX 128
5
6typedef struct
7{
8 void * list_of_watches;
9 void * dormant_watches;
10
11 /*
12 int watch[SH_INOTIFY_MAX];
13 int flag[SH_INOTIFY_MAX];
14 char * file[SH_INOTIFY_MAX];
15 */
16
17 int count;
18 int max_count;
19} sh_watches;
20
21/* #define SH_INOTIFY_INITIALIZER { { 0 }, { 0 }, { NULL}, 0, 0 } */
22
23#define SH_INOTIFY_INITIALIZER { NULL, NULL, 0, 0 }
24
25#define SH_INOTIFY_FILE 0
26#define SH_INOTIFY_DIR 1
27
28int sh_inotify_wait_for_change(char * filename, sh_watches * watches,
29 int * errnum, int waitsec);
30
31int sh_inotify_rm_watch (sh_watches * watches, sh_watches * save, int wd);
32
33int sh_inotify_add_watch(char * filename, sh_watches * watches, int * errnum,
34 int class, unsigned long check_mask, int type);
35
36int sh_inotify_add_watch_later(char * filename, sh_watches * watches, int * errnum,
37 int class, unsigned long check_mask, int type);
38
39char * sh_inotify_pop_dormant(sh_watches * watches, int * class, unsigned long * check_mask, int * type);
40
41void sh_inotify_purge_dormant(sh_watches * watches);
42void sh_inotify_remove(sh_watches * watches);
43void sh_inotify_init(sh_watches * watches);
44
45char * sh_inotify_search_item(sh_watches * watches, int watch,
46 int * class, unsigned long * check_mask, int * type);
47ssize_t sh_inotify_read(char * buffer, size_t count);
48ssize_t sh_inotify_read_timeout(char * buffer, size_t count, int timeout);
49int sh_inotify_recheck_watches (sh_watches * watches, sh_watches * save);
50
51#define SH_INOTIFY_ERROR(a) (a != 0)
52
53#endif
Note: See TracBrowser for help on using the repository browser.