inotifytools.h
Go to the documentation of this file.
#ifndef _inotifytools_H
#define _inotifytools_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdio.h>
#define MAX_STRLEN 4096
struct nstring {
char buf[MAX_STRLEN];
unsigned int len;
};
int inotifytools_str_to_event(char const * event);
int inotifytools_str_to_event_sep(char const * event, char sep);
char * inotifytools_event_to_str(int events);
char * inotifytools_event_to_str_sep(int events, char sep);
void inotifytools_set_filename_by_wd( int wd, char const * filename );
void inotifytools_set_filename_by_filename( char const * oldname,
char const * newname );
void inotifytools_replace_filename( char const * oldname,
char const * newname );
struct inotify_event;
const char* inotifytools_dirname_from_event(struct inotify_event* event,
size_t* dirnamelen);
const char* inotifytools_filename_from_event(struct inotify_event* event,
char const** eventname,
size_t* dirnamelen);
char* inotifytools_dirpath_from_event(struct inotify_event* event);
struct watch;
const char* inotifytools_filename_from_watch(struct watch* w);
const char* inotifytools_filename_from_wd(int wd);
int inotifytools_wd_from_filename( char const * filename );
int inotifytools_remove_watch_by_filename( char const * filename );
int inotifytools_remove_watch_by_wd( int wd );
int inotifytools_watch_file(char const* filename, int events);
int inotifytools_watch_files(char const* filenames[], int events);
int inotifytools_watch_recursively(char const* path, int events);
int inotifytools_watch_recursively_with_exclude(char const* path,
int events,
char const** exclude_list);
// [UH]
int inotifytools_ignore_events_by_regex( char const *pattern, int flags );
int inotifytools_ignore_events_by_inverted_regex( char const *pattern, int flags );
struct inotify_event * inotifytools_next_event( long int timeout );
struct inotify_event * inotifytools_next_events( long int timeout, int num_events );
int inotifytools_error();
int inotifytools_get_stat_by_wd( int wd, int event );
int inotifytools_get_stat_total( int event );
int inotifytools_get_stat_by_filename( char const * filename,
int event );
void inotifytools_initialize_stats();
int inotifytools_initialize();
int inotifytools_init(int fanotify, int watch_filesystem, int verbose);
void inotifytools_cleanup();
int inotifytools_get_num_watches();
int inotifytools_printf(struct inotify_event* event, const char* fmt);
int inotifytools_fprintf(FILE* file,
struct inotify_event* event,
const char* fmt);
int inotifytools_sprintf(struct nstring* out,
struct inotify_event* event,
const char* fmt);
int inotifytools_snprintf(struct nstring* out,
int size,
struct inotify_event* event,
const char* fmt);
void inotifytools_set_printf_timefmt(const char* fmt);
void inotifytools_clear_timefmt();
int inotifytools_get_max_user_watches();
int inotifytools_get_max_user_instances();
int inotifytools_get_max_queued_events();
#ifdef __cplusplus
}
#endif
#endif // _inotifytools_H
inotifytools_init
int inotifytools_init(int fanotify, int watch_filesystem, int verbose)
Definition inotifytools.cpp:344
inotifytools_filename_from_wd
const char * inotifytools_filename_from_wd(int wd)
Definition inotifytools.cpp:936
inotifytools_ignore_events_by_regex
int inotifytools_ignore_events_by_regex(char const *pattern, int flags)
Definition inotifytools.cpp:2408
inotifytools_set_printf_timefmt
void inotifytools_set_printf_timefmt(const char *fmt)
Definition inotifytools.cpp:2299
inotifytools_get_max_queued_events
int inotifytools_get_max_queued_events()
Definition inotifytools.cpp:2315
inotifytools_watch_recursively_with_exclude
int inotifytools_watch_recursively_with_exclude(char const *path, int events, char const **exclude_list)
Definition inotifytools.cpp:1792
inotifytools_remove_watch_by_filename
int inotifytools_remove_watch_by_filename(char const *filename)
Definition inotifytools.cpp:1217
inotifytools_error
int inotifytools_error()
Definition inotifytools.cpp:1911
inotifytools_fprintf
int inotifytools_fprintf(FILE *file, struct inotify_event *event, const char *fmt)
Definition inotifytools.cpp:2037
inotifytools_watch_recursively
int inotifytools_watch_recursively(char const *path, int events)
Definition inotifytools.cpp:1756
inotifytools_wd_from_filename
int inotifytools_wd_from_filename(char const *filename)
Definition inotifytools.cpp:1041
inotifytools_filename_from_event
const char * inotifytools_filename_from_event(struct inotify_event *event, char const **eventname, size_t *dirnamelen)
Definition inotifytools.cpp:984
inotifytools_ignore_events_by_inverted_regex
int inotifytools_ignore_events_by_inverted_regex(char const *pattern, int flags)
Definition inotifytools.cpp:2423
inotifytools_set_filename_by_filename
void inotifytools_set_filename_by_filename(char const *oldname, char const *newname)
Definition inotifytools.cpp:1089
inotifytools_remove_watch_by_wd
int inotifytools_remove_watch_by_wd(int wd)
Definition inotifytools.cpp:1190
inotifytools_event_to_str_sep
char * inotifytools_event_to_str_sep(int events, char sep)
Definition inotifytools.cpp:716
inotifytools_dirname_from_event
const char * inotifytools_dirname_from_event(struct inotify_event *event, size_t *dirnamelen)
Definition inotifytools.cpp:955
inotifytools_str_to_event_sep
int inotifytools_str_to_event_sep(char const *event, char sep)
Definition inotifytools.cpp:524
inotifytools_cleanup
void inotifytools_cleanup()
Definition inotifytools.cpp:415
inotifytools_watch_files
int inotifytools_watch_files(char const *filenames[], int events)
Definition inotifytools.cpp:1266
inotifytools_dirpath_from_event
char * inotifytools_dirpath_from_event(struct inotify_event *event)
Definition inotifytools.cpp:1010
inotifytools_get_max_user_instances
int inotifytools_get_max_user_instances()
Definition inotifytools.cpp:2331
inotifytools_next_event
struct inotify_event * inotifytools_next_event(long int timeout)
Definition inotifytools.cpp:1440
inotifytools_get_num_watches
int inotifytools_get_num_watches()
Definition inotifytools.cpp:1938
inotifytools_event_to_str
char * inotifytools_event_to_str(int events)
Definition inotifytools.cpp:688
inotifytools_str_to_event
int inotifytools_str_to_event(char const *event)
Definition inotifytools.cpp:602
inotifytools_replace_filename
void inotifytools_replace_filename(char const *oldname, char const *newname)
Definition inotifytools.cpp:1121
inotifytools_filename_from_watch
const char * inotifytools_filename_from_watch(struct watch *w)
Definition inotifytools.cpp:907
inotifytools_get_max_user_watches
int inotifytools_get_max_user_watches()
Definition inotifytools.cpp:2347
inotifytools_snprintf
int inotifytools_snprintf(struct nstring *out, int size, struct inotify_event *event, const char *fmt)
Definition inotifytools.cpp:2156
inotifytools_next_events
struct inotify_event * inotifytools_next_events(long int timeout, int num_events)
Definition inotifytools.cpp:1496
inotifytools_printf
int inotifytools_printf(struct inotify_event *event, const char *fmt)
Definition inotifytools.cpp:1988
inotifytools_sprintf
int inotifytools_sprintf(struct nstring *out, struct inotify_event *event, const char *fmt)
Definition inotifytools.cpp:2100
inotifytools_set_filename_by_wd
void inotifytools_set_filename_by_wd(int wd, char const *filename)
Definition inotifytools.cpp:1065
inotifytools_watch_file
int inotifytools_watch_file(char const *filename, int events)
Definition inotifytools.cpp:1244
nstring
This structure holds string that can contain any character including NULL.
Definition inotifytools.h:20
nstring::len
unsigned int len
Definition inotifytools.h:22
nstring::buf
char buf[MAX_STRLEN]
Definition inotifytools.h:21