"Fossies" - the Fresh Open Source Software Archive

Member "inotify-tools-3.20.11.0/libinotifytools/src/inotifytools/inotifytools.h" (13 Nov 2020, 3095 Bytes) of package /linux/privat/inotify-tools-3.20.11.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "inotifytools.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.20.2.2_vs_3.20.11.0.

    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
   10 extern "C"
   11 {
   12 #endif
   13 
   14 #include <stdio.h>
   15 
   16 #define MAX_STRLEN 4096
   17 
   18 /** @struct nstring
   19  *  @brief This structure holds string that can contain any charater including NULL.
   20  *  @var nstring::buf
   21  *  Member 'buf' contains character buffer.  It can hold up to 4096 characters.
   22  *  @var nstring::len
   23  *  Member 'len' contains number of characters in buffer.
   24  */
   25 struct nstring {
   26     char buf[MAX_STRLEN];
   27     unsigned int len;
   28 };
   29 
   30 int inotifytools_str_to_event(char const * event);
   31 int inotifytools_str_to_event_sep(char const * event, char sep);
   32 char * inotifytools_event_to_str(int events);
   33 char * inotifytools_event_to_str_sep(int events, char sep);
   34 void inotifytools_set_filename_by_wd( int wd, char const * filename );
   35 void inotifytools_set_filename_by_filename( char const * oldname,
   36                                             char const * newname );
   37 void inotifytools_replace_filename( char const * oldname,
   38                                     char const * newname );
   39 char * inotifytools_filename_from_wd( int wd );
   40 int inotifytools_wd_from_filename( char const * filename );
   41 int inotifytools_remove_watch_by_filename( char const * filename );
   42 int inotifytools_remove_watch_by_wd( int wd );
   43 int inotifytools_watch_file( char const * filename, int events );
   44 int inotifytools_watch_files( char const * filenames[], int events );
   45 int inotifytools_watch_recursively( char const * path, int events );
   46 int inotifytools_watch_recursively_with_exclude( char const * path,
   47                                                  int events,
   48                                                  char const ** exclude_list );
   49                                                  // [UH]
   50 int inotifytools_ignore_events_by_regex( char const *pattern, int flags );
   51 int inotifytools_ignore_events_by_inverted_regex( char const *pattern, int flags );
   52 struct inotify_event * inotifytools_next_event( long int timeout );
   53 struct inotify_event * inotifytools_next_events( long int timeout, int num_events );
   54 int inotifytools_error();
   55 int inotifytools_get_stat_by_wd( int wd, int event );
   56 int inotifytools_get_stat_total( int event );
   57 int inotifytools_get_stat_by_filename( char const * filename,
   58                                                 int event );
   59 void inotifytools_initialize_stats();
   60 int inotifytools_initialize();
   61 void inotifytools_cleanup();
   62 int inotifytools_get_num_watches();
   63 
   64 int inotifytools_printf( struct inotify_event* event, char* fmt );
   65 int inotifytools_fprintf( FILE* file, struct inotify_event* event, char* fmt );
   66 int inotifytools_sprintf( struct nstring * out, struct inotify_event* event, char* fmt );
   67 int inotifytools_snprintf( struct nstring * out, int size, struct inotify_event* event,
   68                            char* fmt );
   69 void inotifytools_set_printf_timefmt( char * fmt );
   70 
   71 int inotifytools_get_max_user_watches();
   72 int inotifytools_get_max_user_instances();
   73 int inotifytools_get_max_queued_events();
   74 
   75 #ifdef __cplusplus
   76 }
   77 #endif
   78 
   79 #endif     // _inotifytools_H