blob: 4e0ec8b3cc8414e85b452343299a1888e702c6de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
.TH "inotify-cxx.h" 3 "18 Apr 2007" "Version 0.7.2" "inotify-cxx" \" -*- nroff -*-
.ad l
.nh
.SH NAME
inotify-cxx.h \- inotify C++ interface header
.SH SYNOPSIS
.br
.PP
\fC#include <stdint.h>\fP
.br
\fC#include <string>\fP
.br
\fC#include <deque>\fP
.br
\fC#include <map>\fP
.br
\fC#include <sys/syscall.h>\fP
.br
\fC#include <sys/inotify.h>\fP
.br
\fC#include <sys/inotify-syscalls.h>\fP
.br
.SS "Classes"
.in +1c
.ti -1c
.RI "class \fBInotifyException\fP"
.br
.RI "\fIClass for inotify exceptions. \fP"
.ti -1c
.RI "class \fBInotifyEvent\fP"
.br
.RI "\fIinotify event class \fP"
.ti -1c
.RI "class \fBInotifyWatch\fP"
.br
.RI "\fIinotify watch class \fP"
.ti -1c
.RI "class \fBInotify\fP"
.br
.RI "\fIinotify class \fP"
.in -1c
.SS "Defines"
.in +1c
.ti -1c
.RI "#define \fBINOTIFY_EVENT_SIZE\fP (sizeof(struct inotify_event))"
.br
.RI "\fIEvent struct size. \fP"
.ti -1c
.RI "#define \fBINOTIFY_BUFLEN\fP (1024 * (INOTIFY_EVENT_SIZE + 16))"
.br
.RI "\fIEvent buffer length. \fP"
.ti -1c
.RI "#define \fBIN_EXC_MSG\fP(msg) (std::string(__PRETTY_FUNCTION__) + ': ' + msg)"
.br
.RI "\fIHelper macro for creating exception messages. \fP"
.ti -1c
.RI "#define \fBIN_LOCK_DECL\fP"
.br
.RI "\fIinotify-cxx thread safety \fP"
.ti -1c
.RI "#define \fBIN_LOCK_INIT\fP"
.br
.ti -1c
.RI "#define \fBIN_LOCK_DONE\fP"
.br
.ti -1c
.RI "#define \fBIN_READ_BEGIN\fP"
.br
.ti -1c
.RI "#define \fBIN_READ_END\fP"
.br
.ti -1c
.RI "#define \fBIN_READ_END_NOTHROW\fP"
.br
.ti -1c
.RI "#define \fBIN_WRITE_BEGIN\fP"
.br
.ti -1c
.RI "#define \fBIN_WRITE_END\fP"
.br
.ti -1c
.RI "#define \fBIN_WRITE_END_NOTHROW\fP"
.br
.in -1c
.SS "Typedefs"
.in +1c
.ti -1c
.RI "typedef std::map< int32_t, \fBInotifyWatch\fP * > \fBIN_WATCH_MAP\fP"
.br
.RI "\fIMapping from watch descriptors to watch objects. \fP"
.ti -1c
.RI "typedef std::map< std::string, \fBInotifyWatch\fP * > \fBIN_WP_MAP\fP"
.br
.RI "\fIMapping from paths to watch objects. \fP"
.in -1c
.SS "Enumerations"
.in +1c
.ti -1c
.RI "enum \fBInotifyCapability_t\fP { \fBIN_MAX_EVENTS\fP = 0, \fBIN_MAX_INSTANCES\fP = 1, \fBIN_MAX_WATCHES\fP = 2 }"
.br
.RI "\fIinotify capability/limit identifiers \fP"
.in -1c
.SH "Detailed Description"
.PP
inotify C++ interface header
inotify C++ interface
.PP
Copyright (C) 2006, 2007 Lukas Jelinek, <lukas@aiken.cz>
.PP
This program is free software; you can redistribute it and/or modify it under the terms of one of the following licenses:
.PP
.PD 0
.IP "\(bu" 2
1. X11-style license (see LICENSE-X11)
.IP "\(bu" 2
2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL)
.IP "\(bu" 2
3. GNU General Public License, version 2 (see LICENSE-GPL)
.PP
If you want to help with choosing the best license for you, please visit http://www.gnu.org/licenses/license-list.html.
.SH "Define Documentation"
.PP
.SS "#define IN_EXC_MSG(msg) (std::string(__PRETTY_FUNCTION__) + ': ' + msg)"
.PP
Helper macro for creating exception messages.
.PP
It prepends the message by the function name.
.SS "#define IN_LOCK_DECL"
.PP
inotify-cxx thread safety
.PP
If this symbol is defined you can use this interface safely threaded applications. Remember that it slightly degrades performance.
.PP
Even if INOTIFY_THREAD_SAFE is defined some classes stay unsafe. If you must use them (must you?) in more than one thread concurrently you need to implement explicite locking.
.PP
You need not to define INOTIFY_THREAD_SAFE in that cases where the application is multithreaded but all the inotify infrastructure will be managed only in one thread. This is the recommended way.
.PP
Locking may fail (it is very rare but not impossible). In this case an exception is thrown. But if unlocking fails in case of an error it does nothing (this failure is ignored).
.SS "#define IN_LOCK_DONE"
.PP
.SS "#define IN_LOCK_INIT"
.PP
.SS "#define IN_READ_BEGIN"
.PP
.SS "#define IN_READ_END"
.PP
.SS "#define IN_READ_END_NOTHROW"
.PP
.SS "#define IN_WRITE_BEGIN"
.PP
.SS "#define IN_WRITE_END"
.PP
.SS "#define IN_WRITE_END_NOTHROW"
.PP
.SS "#define INOTIFY_BUFLEN (1024 * (INOTIFY_EVENT_SIZE + 16))"
.PP
Event buffer length.
.PP
.SS "#define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event))"
.PP
Event struct size.
.PP
.SH "Typedef Documentation"
.PP
.SS "typedef std::map<int32_t, \fBInotifyWatch\fP*> \fBIN_WATCH_MAP\fP"
.PP
Mapping from watch descriptors to watch objects.
.PP
.SS "typedef std::map<std::string, \fBInotifyWatch\fP*> \fBIN_WP_MAP\fP"
.PP
Mapping from paths to watch objects.
.PP
.SH "Enumeration Type Documentation"
.PP
.SS "enum \fBInotifyCapability_t\fP"
.PP
inotify capability/limit identifiers
.PP
\fBEnumerator: \fP
.in +1c
.TP
\fB\fIIN_MAX_EVENTS \fP\fP
max. events in the kernel queue
.TP
\fB\fIIN_MAX_INSTANCES \fP\fP
max. inotify file descriptors per process
.TP
\fB\fIIN_MAX_WATCHES \fP\fP
max. watches per file descriptor
.SH "Author"
.PP
Generated automatically by Doxygen for inotify-cxx from the source code.
|