libinotifytools
inotifytools.h
Go to the documentation of this file.
1#ifndef _inotifytools_H
2#define _inotifytools_H
3
15
101
102#ifdef __cplusplus
103extern "C"
104{
105#endif
106
107#include <stdio.h>
108
109#define MAX_STRLEN 4096
110
118struct nstring {
119 char buf[MAX_STRLEN];
120 unsigned int len;
121};
122
146int inotifytools_str_to_event(char const * event);
147
175int inotifytools_str_to_event_sep(char const * event, char sep);
176
198char * inotifytools_event_to_str(int events);
199
224char * inotifytools_event_to_str_sep(int events, char sep);
225
240void inotifytools_set_filename_by_wd( int wd, char const * filename );
241
256void inotifytools_set_filename_by_filename( char const * oldname,
257 char const * newname );
258
281void inotifytools_replace_filename( char const * oldname,
282 char const * newname );
283struct inotify_event;
284
293const char* inotifytools_dirname_from_event(struct inotify_event* event,
294 size_t* dirnamelen);
295
304const char* inotifytools_filename_from_event(struct inotify_event* event,
305 char const** eventname,
306 size_t* dirnamelen);
307
316char* inotifytools_dirpath_from_event(struct inotify_event* event);
317struct watch;
318
325const char* inotifytools_filename_from_watch(struct watch* w);
326
348
363int inotifytools_wd_from_filename( char const * filename );
364
376int inotifytools_remove_watch_by_filename( char const * filename );
377
391
403int inotifytools_watch_file(char const* filename, int events);
404
420int inotifytools_watch_files(char const* filenames[], int events);
421
447int inotifytools_watch_recursively(char const* path, int events);
448
482 int events,
483 char const** exclude_list);
484// [UH]
496int inotifytools_ignore_events_by_regex( char const *pattern, int flags, int recursive );
497
509int inotifytools_ignore_events_by_inverted_regex( char const *pattern, int flags, int recursive );
510
537struct inotify_event * inotifytools_next_event( long int timeout );
538
587struct inotify_event * inotifytools_next_events( long int timeout, int num_events );
588
600
616int inotifytools_get_stat_by_wd( int wd, int event );
617
632
652int inotifytools_get_stat_by_filename( char const * filename,
653 int event );
654
668int inotifytools_initialize();
669
680int inotifytools_init(int fanotify, int watch_filesystem, int verbose);
681
689
697
742int inotifytools_printf(struct inotify_event* event, const char* fmt);
743
789int inotifytools_fprintf(FILE* file,
790 struct inotify_event* event,
791 const char* fmt);
792
845int inotifytools_sprintf(struct nstring* out,
846 struct inotify_event* event,
847 const char* fmt);
848
899int inotifytools_snprintf(struct nstring* out,
900 int size,
901 struct inotify_event* event,
902 const char* fmt);
903
914void inotifytools_clear_timefmt();
915
926
937
947
948#ifdef __cplusplus
949}
950#endif
951
952#endif // _inotifytools_H
int inotifytools_init(int fanotify, int watch_filesystem, int verbose)
const char * inotifytools_filename_from_wd(int wd)
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_ignore_events_by_regex(char const *pattern, int flags, int recursive)
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)
const char * inotifytools_filename_from_event(struct inotify_event *event, char const **eventname, size_t *dirnamelen)
int inotifytools_get_stat_by_filename(char const *filename, int event)
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_ignore_events_by_inverted_regex(char const *pattern, int flags, int recursive)
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)
void inotifytools_initialize_stats()
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_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.
unsigned int len
char buf[MAX_STRLEN]