00001 #ifndef _inotifytools_H
00002 #define _inotifytools_H
00003
00004 #include <stdio.h>
00005
00006 int inotifytools_str_to_event(char const * event);
00007 int inotifytools_str_to_event_sep(char const * event, char sep);
00008 char * inotifytools_event_to_str(int events);
00009 char * inotifytools_event_to_str_sep(int events, char sep);
00010 void inotifytools_set_filename_by_wd( int wd, char const * filename );
00011 void inotifytools_set_filename_by_filename( char const * oldname,
00012 char const * newname );
00013 void inotifytools_replace_filename( char const * oldname,
00014 char const * newname );
00015 char * inotifytools_filename_from_wd( int wd );
00016 int inotifytools_wd_from_filename( char const * filename );
00017 int inotifytools_remove_watch_by_filename( char const * filename );
00018 int inotifytools_remove_watch_by_wd( int wd );
00019 int inotifytools_watch_file( char const * filename, int events );
00020 int inotifytools_watch_files( char const * filenames[], int events );
00021 int inotifytools_watch_recursively( char const * path, int events );
00022 int inotifytools_watch_recursively_with_exclude( char const * path,
00023 int events,
00024 char const ** exclude_list );
00025
00026 struct inotify_event * inotifytools_next_event( int timeout );
00027 struct inotify_event * inotifytools_next_events( int timeout, int num_events );
00028 int inotifytools_error();
00029 int inotifytools_get_stat_by_wd( int wd, int event );
00030 int inotifytools_get_stat_total( int event );
00031 int inotifytools_get_stat_by_filename( char const * filename,
00032 int event );
00033 void inotifytools_initialize_stats();
00034 int inotifytools_initialize();
00035 int inotifytools_get_num_watches();
00036
00037 int inotifytools_printf( struct inotify_event* event, char* fmt );
00038 int inotifytools_fprintf( FILE* file, struct inotify_event* event, char* fmt );
00039 int inotifytools_sprintf( char * out, struct inotify_event* event, char* fmt );
00040 int inotifytools_snprintf( char * out, int size, struct inotify_event* event,
00041 char* fmt );
00042 void inotifytools_set_printf_timefmt( char * fmt );
00043
00044 int inotifytools_get_max_user_watches();
00045 int inotifytools_get_max_user_instances();
00046 int inotifytools_get_max_queued_events();
00047
00048 #endif // _inotifytools_H