fswatch 1.17.1
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
35extern "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
82 extern const enum fsw_event_flag FSW_ALL_EVENT_FLAGS[15];
83
96 FSW_STATUS fsw_get_event_flag_by_name(const char *name, enum fsw_event_flag *flag);
97
107 char *fsw_get_event_flag_name(const enum fsw_event_flag flag);
108
116 typedef struct fsw_cevent
117 {
118 char * path;
119 time_t evt_time;
120 enum fsw_event_flag * flags;
121 unsigned int flags_num;
123
136 typedef void (*FSW_CEVENT_CALLBACK)(fsw_cevent const *const events,
137 const unsigned int event_num,
138 void *data);
139
140# ifdef __cplusplus
141}
142# endif
143
144#endif /* FSW__CEVENT_H */
char * fsw_get_event_flag_name(const enum fsw_event_flag flag)
Get the name of an event flag.
Definition: cevent.cpp:58
FSW_STATUS fsw_get_event_flag_by_name(const char *name, enum fsw_event_flag *flag)
Get event flag by name.
Definition: cevent.cpp:44
struct fsw_cevent fsw_cevent
fsw_event_flag
Backend-agnostic change flags.
Definition: cevent.h:64
@ Renamed
Definition: cevent.h:70
@ MovedTo
Definition: cevent.h:74
@ Removed
Definition: cevent.h:69
@ Updated
Definition: cevent.h:68
@ Overflow
Definition: cevent.h:79
@ IsSymLink
Definition: cevent.h:77
@ OwnerModified
Definition: cevent.h:71
@ MovedFrom
Definition: cevent.h:73
@ IsDir
Definition: cevent.h:76
@ AttributeModified
Definition: cevent.h:72
@ Created
Definition: cevent.h:67
@ PlatformSpecific
Definition: cevent.h:66
@ IsFile
Definition: cevent.h:75
@ NoOp
Definition: cevent.h:65
@ Link
Definition: cevent.h:78
void(* FSW_CEVENT_CALLBACK)(fsw_cevent const *const events, const unsigned int event_num, void *data)
Definition: cevent.h:136
Header of the libfswatch library containing common types.
int FSW_STATUS
Status of a library call.
Definition: libfswatch_types.h:49
Definition: cevent.h:117