libinotifytools
inotifytools.h
Go to the documentation of this file.
1#ifndef _inotifytools_H
2#define _inotifytools_H
3
4#ifdef __cplusplus
5extern "C"
6{
7#endif
8
9#include <stdio.h>
10
11#define MAX_STRLEN 4096
12
20struct nstring {
21 char buf[MAX_STRLEN];
22 unsigned int len;
23};
24
25int inotifytools_str_to_event(char const * event);
26int inotifytools_str_to_event_sep(char const * event, char sep);
27char * inotifytools_event_to_str(int events);
28char * inotifytools_event_to_str_sep(int events, char sep);
29void inotifytools_set_filename_by_wd( int wd, char const * filename );
30void inotifytools_set_filename_by_filename( char const * oldname,
31 char const * newname );
32void inotifytools_replace_filename( char const * oldname,
33 char const * newname );
34struct inotify_event;
35const char* inotifytools_dirname_from_event(struct inotify_event* event,
36 size_t* dirnamelen);
37const char* inotifytools_filename_from_event(struct inotify_event* event,
38 char const** eventname,
39 size_t* dirnamelen);
40char* inotifytools_dirpath_from_event(struct inotify_event* event);
41struct watch;
42const char* inotifytools_filename_from_watch(struct watch* w);
43const char* inotifytools_filename_from_wd(int wd);
44int inotifytools_wd_from_filename( char const * filename );
45int inotifytools_remove_watch_by_filename( char const * filename );
47int inotifytools_watch_file(char const* filename, int events);
48int inotifytools_watch_files(char const* filenames[], int events);
49int inotifytools_watch_recursively(char const* path, int events);
51 int events,
52 char const** exclude_list);
53// [UH]
54int inotifytools_ignore_events_by_regex( char const *pattern, int flags );
55int inotifytools_ignore_events_by_inverted_regex( char const *pattern, int flags );
56struct inotify_event * inotifytools_next_event( long int timeout );
57struct inotify_event * inotifytools_next_events( long int timeout, int num_events );
59int inotifytools_get_stat_by_wd( int wd, int event );
60int inotifytools_get_stat_total( int event );
61int inotifytools_get_stat_by_filename( char const * filename,
62 int event );
63void inotifytools_initialize_stats();
64int inotifytools_initialize();
65int inotifytools_init(int fanotify, int watch_filesystem, int verbose);
68
69int inotifytools_printf(struct inotify_event* event, const char* fmt);
70int inotifytools_fprintf(FILE* file,
71 struct inotify_event* event,
72 const char* fmt);
73int inotifytools_sprintf(struct nstring* out,
74 struct inotify_event* event,
75 const char* fmt);
76int inotifytools_snprintf(struct nstring* out,
77 int size,
78 struct inotify_event* event,
79 const char* fmt);
80void inotifytools_set_printf_timefmt(const char* fmt);
81void inotifytools_clear_timefmt();
82
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif // _inotifytools_H
int inotifytools_init(int fanotify, int watch_filesystem, int verbose)
const char * inotifytools_filename_from_wd(int wd)
int inotifytools_ignore_events_by_regex(char const *pattern, int flags)
void inotifytools_set_printf_timefmt(const char *fmt)
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)
int inotifytools_error()
int inotifytools_fprintf(FILE *file, struct inotify_event *event, const char *fmt)
int inotifytools_watch_recursively(char const *path, int events)
int inotifytools_wd_from_filename(char const *filename)
const char * inotifytools_filename_from_event(struct inotify_event *event, char const **eventname, size_t *dirnamelen)
int inotifytools_ignore_events_by_inverted_regex(char const *pattern, int flags)
void inotifytools_set_filename_by_filename(char const *oldname, char const *newname)
int inotifytools_remove_watch_by_wd(int wd)
char * inotifytools_event_to_str_sep(int events, char sep)
const char * inotifytools_dirname_from_event(struct inotify_event *event, size_t *dirnamelen)
int inotifytools_str_to_event_sep(char const *event, char sep)
void inotifytools_cleanup()
int inotifytools_watch_files(char const *filenames[], int events)
char * inotifytools_dirpath_from_event(struct inotify_event *event)
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)
int inotifytools_str_to_event(char const *event)
void inotifytools_replace_filename(char const *oldname, char const *newname)
const char * inotifytools_filename_from_watch(struct watch *w)
int inotifytools_get_max_user_watches()
int inotifytools_snprintf(struct nstring *out, int size, struct inotify_event *event, const char *fmt)
struct inotify_event * inotifytools_next_events(long int timeout, int num_events)
int inotifytools_printf(struct inotify_event *event, const char *fmt)
int inotifytools_sprintf(struct nstring *out, struct inotify_event *event, const char *fmt)
void inotifytools_set_filename_by_wd(int wd, char const *filename)
int inotifytools_watch_file(char const *filename, int events)
This structure holds string that can contain any character including NULL.
Definition: inotifytools.h:20
unsigned int len
Definition: inotifytools.h:22
char buf[MAX_STRLEN]
Definition: inotifytools.h:21