source: trunk/include/sh_inotify.h@ 368

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

Modifications for ticket #265 (inotify support). Needs testing.

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