libfswatch  1.9.3
cevent.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015 Enrico M. Crisostomo
3  *
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 3, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU General Public License along with
14  * this program. If not, see <http://www.gnu.org/licenses/>.
15  */
27 #ifndef FSW__CEVENT_H
28 # define FSW__CEVENT_H
29 
30 # include <time.h>
31 # include <limits.h>
32 # include "libfswatch_types.h"
33 
34 # ifdef __cplusplus
35 extern "C"
36 {
37 # endif
38 
64  {
65  NoOp = 0,
66  PlatformSpecific = (1 << 0),
67  Created = (1 << 1),
68  Updated = (1 << 2),
69  Removed = (1 << 3),
70  Renamed = (1 << 4),
71  OwnerModified = (1 << 5),
72  AttributeModified = (1 << 6),
73  MovedFrom = (1 << 7),
74  MovedTo = (1 << 8),
75  IsFile = (1 << 9),
76  IsDir = (1 << 10),
77  IsSymLink = (1 << 11),
78  Link = (1 << 12),
79  Overflow = (1 << 13)
80  };
81 
94  FSW_STATUS fsw_get_event_flag_by_name(const char *name, enum fsw_event_flag *flag);
95 
105  char *fsw_get_event_flag_name(const enum fsw_event_flag flag);
106 
114  typedef struct fsw_cevent
115  {
116  char * path;
117  time_t evt_time;
118  enum fsw_event_flag * flags;
119  unsigned int flags_num;
120  } fsw_cevent;
121 
134  typedef void (*FSW_CEVENT_CALLBACK)(fsw_cevent const *const events,
135  const unsigned int event_num,
136  void *data);
137 
138 # ifdef __cplusplus
139 }
140 # endif
141 
142 #endif /* FSW__CEVENT_H */
int FSW_STATUS
Status of a library call.
Definition: libfswatch_types.h:44
fsw_event_flag
Backend-agnostic change flags.
Definition: cevent.h:63
struct fsw_cevent fsw_cevent
Definition: cevent.h:74
Definition: cevent.h:79
Definition: cevent.h:67
Definition: cevent.h:68
Definition: cevent.h:70
void(* FSW_CEVENT_CALLBACK)(fsw_cevent const *const events, const unsigned int event_num, void *data)
Definition: cevent.h:134
Definition: cevent.h:77
Definition: cevent.h:114
Header of the libfswatch library containing common types.
Definition: cevent.h:69
char * fsw_get_event_flag_name(const enum fsw_event_flag flag)
Get the name of an event flag.
Definition: cevent.cpp:43
Definition: cevent.h:73
Definition: cevent.h:72
Definition: cevent.h:75
Definition: cevent.h:76
Definition: cevent.h:78
Definition: cevent.h:66
Definition: cevent.h:71
Definition: cevent.h:65
FSW_STATUS fsw_get_event_flag_by_name(const char *name, enum fsw_event_flag *flag)
Get event flag by name.
Definition: cevent.cpp:29