libinotifytools
inotifytools.h
Go to the documentation of this file.
1#ifndef _inotifytools_H
2#define _inotifytools_H
3
4#ifdef __FreeBSD__
5#define stat64 stat
6#define lstat64 lstat
7#endif
8
9#ifdef __cplusplus
10extern "C"
11{
12#endif
13
14#include <stdio.h>
15
16#define MAX_STRLEN 4096
17
25struct nstring {
26 char buf[MAX_STRLEN];
27 unsigned int len;
28};
29
30int inotifytools_str_to_event(char const * event);
31int inotifytools_str_to_event_sep(char const * event, char sep);
32char * inotifytools_event_to_str(int events);
33char * inotifytools_event_to_str_sep(int events, char sep);
34void inotifytools_set_filename_by_wd( int wd, char const * filename );
35void inotifytools_set_filename_by_filename( char const * oldname,
36 char const * newname );
37void inotifytools_replace_filename( char const * oldname,
38 char const * newname );
39char * inotifytools_filename_from_wd( int wd );
40int inotifytools_wd_from_filename( char const * filename );
41int inotifytools_remove_watch_by_filename( char const * filename );
43int inotifytools_watch_file( char const * filename, int events );
44int inotifytools_watch_files( char const * filenames[], int events );
45int inotifytools_watch_recursively( char const * path, int events );
47 int events,
48 char const ** exclude_list );
49 // [UH]
50int inotifytools_ignore_events_by_regex( char const *pattern, int flags );
51int inotifytools_ignore_events_by_inverted_regex( char const *pattern, int flags );
52struct inotify_event * inotifytools_next_event( long int timeout );
53struct inotify_event * inotifytools_next_events( long int timeout, int num_events );
55int inotifytools_get_stat_by_wd( int wd, int event );
56int inotifytools_get_stat_total( int event );
57int inotifytools_get_stat_by_filename( char const * filename,
58 int event );
63
64int inotifytools_printf( struct inotify_event* event, char* fmt );
65int inotifytools_fprintf( FILE* file, struct inotify_event* event, char* fmt );
66int inotifytools_sprintf( struct nstring * out, struct inotify_event* event, char* fmt );
67int inotifytools_snprintf( struct nstring * out, int size, struct inotify_event* event,
68 char* fmt );
69void inotifytools_set_printf_timefmt( char * fmt );
70
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif // _inotifytools_H
int inotifytools_ignore_events_by_regex(char const *pattern, int flags)
int inotifytools_get_max_queued_events()
int inotifytools_watch_recursively_with_exclude(char const *path, int events, char const **exclude_list)
int inotifytools_remove_watch_by_filename(char const *filename)
Definition: inotifytools.c:949
int inotifytools_error()
int inotifytools_initialize()
Definition: inotifytools.c:283
char * inotifytools_filename_from_wd(int wd)
Definition: inotifytools.c:779
int inotifytools_get_stat_by_wd(int wd, int event)
int inotifytools_watch_recursively(char const *path, int events)
int inotifytools_wd_from_filename(char const *filename)
Definition: inotifytools.c:802
int inotifytools_fprintf(FILE *file, struct inotify_event *event, char *fmt)
int inotifytools_ignore_events_by_inverted_regex(char const *pattern, int flags)
int inotifytools_get_stat_by_filename(char const *filename, int event)
void inotifytools_set_filename_by_filename(char const *oldname, char const *newname)
Definition: inotifytools.c:845
int inotifytools_remove_watch_by_wd(int wd)
Definition: inotifytools.c:926
char * inotifytools_event_to_str_sep(int events, char sep)
Definition: inotifytools.c:672
int inotifytools_str_to_event_sep(char const *event, char sep)
Definition: inotifytools.c:478
void inotifytools_cleanup()
Definition: inotifytools.c:328
int inotifytools_watch_files(char const *filenames[], int events)
Definition: inotifytools.c:994
int inotifytools_snprintf(struct nstring *out, int size, struct inotify_event *event, char *fmt)
int inotifytools_get_max_user_instances()
struct inotify_event * inotifytools_next_event(long int timeout)
int inotifytools_get_num_watches()
char * inotifytools_event_to_str(int events)
Definition: inotifytools.c:644
int inotifytools_printf(struct inotify_event *event, char *fmt)
int inotifytools_str_to_event(char const *event)
Definition: inotifytools.c:557
void inotifytools_replace_filename(char const *oldname, char const *newname)
Definition: inotifytools.c:875
void inotifytools_initialize_stats()
Definition: inotifytools.c:425
int inotifytools_get_max_user_watches()
struct inotify_event * inotifytools_next_events(long int timeout, int num_events)
int inotifytools_get_stat_total(int event)
void inotifytools_set_printf_timefmt(char *fmt)
int inotifytools_sprintf(struct nstring *out, struct inotify_event *event, char *fmt)
void inotifytools_set_filename_by_wd(int wd, char const *filename)
Definition: inotifytools.c:823
int inotifytools_watch_file(char const *filename, int events)
Definition: inotifytools.c:972
This structure holds string that can contain any charater including NULL.
Definition: inotifytools.h:25
unsigned int len
Definition: inotifytools.h:27
char buf[MAX_STRLEN]
Definition: inotifytools.h:26