aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-06-04 12:01:29 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2013-06-04 12:01:29 +0300
commit0cb5eaca7e4b6f5a8fbd0fc6c30550ebf9a9583b (patch)
tree484ea838b5ccfd96a9ec564fd0998225c9460570
parent63e6bec45c4c1cb8c3c7536d616e74dd07127895 (diff)
downloaddirevent-0cb5eaca7e4b6f5a8fbd0fc6c30550ebf9a9583b.tar.gz
direvent-0cb5eaca7e4b6f5a8fbd0fc6c30550ebf9a9583b.tar.bz2
Update docs.
* NEWS: Update. * doc/dircond.conf.5: Update. * doc/dircond.texi: Update. * src/config.c (cb_watcher): Treat missing "event" statement as "all events". * src/dircond.h (evtsetall): New prototype. * src/event.c (evtsetall): New function. * src/environ.c: Minor fix.
-rw-r--r--NEWS6
-rw-r--r--doc/dircond.conf.54
-rw-r--r--doc/dircond.texi2
-rw-r--r--src/config.c6
-rw-r--r--src/dircond.h1
-rw-r--r--src/environ.c2
-rw-r--r--src/event.c11
7 files changed, 25 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 6444c82..3807aac 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,14 @@
-dircond -- history of user-visible changes. 2013-05-29
+dircond -- history of user-visible changes. 2013-06-04
Copyright (C) 2012, 2013 Sergey Poznyakoff
See the end of file for copying conditions.
Please send dircond bug reports to <gray+dircond@gnu.org.ua>
Version 3.99.90 (Git)
+
+This is a complete rewrite of the project. It uses a new
+configuration file format and works on Linux, BSD and Darwin.
+
Version 3.0 (Git)
diff --git a/doc/dircond.conf.5 b/doc/dircond.conf.5
index 3c2f211..c035acd 100644
--- a/doc/dircond.conf.5
+++ b/doc/dircond.conf.5
@@ -13,7 +13,7 @@
.\"
.\" You should have received a copy of the GNU General Public License along
.\" with dircond. If not, see <http://www.gnu.org/licenses/>.
-.TH DIRCOND.CONF 5 "June 3, 2013" "DIRCOND" "Dircond User Reference"
+.TH DIRCOND.CONF 5 "June 4, 2013" "DIRCOND" "Dircond User Reference"
dircond.conf \- configuration file for
.BR dircond (8).
.SH DESCRIPTION
@@ -418,6 +418,8 @@ the \fBpath\fR statements. The argument is a list of event names. Both
generic and system-dependent event namess are allowed. Multiple
\fBevent\fR statements accumulate.
.
+A missing \fBevent\fR statements means watch all events.
+.
For example:
.RS
.sp
diff --git a/doc/dircond.texi b/doc/dircond.texi
index e178621..75a84b2 100644
--- a/doc/dircond.texi
+++ b/doc/dircond.texi
@@ -793,6 +793,8 @@ the @code{path} statements. The argument is a list of event names. Both
generic and system-dependent event namess are allowed. Multiple
@code{event} statements accumulate.
+A missing @code{event} statement means ``watch all events''.
+
For example:
@example
diff --git a/src/config.c b/src/config.c
index c3b9395..7e0ae4b 100644
--- a/src/config.c
+++ b/src/config.c
@@ -249,10 +249,8 @@ cb_watcher(enum grecs_callback_command cmd, grecs_node_t *node,
grecs_error(&node->locus, 0, "no command configured");
++err;
}
- if (evtnullp(&eventconf.eventmask)) {
- grecs_error(&node->locus, 0, "no events configured");
- ++err;
- }
+ if (evtnullp(&eventconf.eventmask))
+ evtsetall(&eventconf.eventmask);
if (err == 0)
eventconf_flush(&node->locus);
else
diff --git a/src/dircond.h b/src/dircond.h
index f781306..06d8003 100644
--- a/src/dircond.h
+++ b/src/dircond.h
@@ -118,6 +118,7 @@ int defevt(const char *name, event_mask *mask, int line);
int getevt(const char *name, event_mask *mask);
int evtnullp(event_mask *mask);
event_mask *event_mask_init(event_mask *m, int fflags, event_mask const *);
+void evtsetall(event_mask *m);
/* Translate generic events to system ones and vice-versa */
extern event_mask genev_xlat[];
diff --git a/src/environ.c b/src/environ.c
index fed2e9d..a28d6b8 100644
--- a/src/environ.c
+++ b/src/environ.c
@@ -119,7 +119,7 @@ environ_setup(char **hint, char **kve)
int wsflags = WRDSF_NOCMD | WRDSF_QUOTE | WRDSF_NOSPLIT |
WRDSF_ENV | WRDSF_ENV_KV;
- ws.ws_env = kve;
+ ws.ws_env = (const char **) kve;
if (!hint)
hint = empty;
diff --git a/src/event.c b/src/event.c
index bbf9181..4959859 100644
--- a/src/event.c
+++ b/src/event.c
@@ -147,4 +147,15 @@ event_mask_init(event_mask *m, int fflags, event_mask const *req)
return m;
}
+void
+evtsetall(event_mask *m)
+{
+ int i;
+ m->sys_mask = 0;
+ m->gen_mask = 0;
+ for (i = 0; i < genev_xlat[i].gen_mask; i++) {
+ m->gen_mask |= genev_xlat[i].gen_mask;
+ m->sys_mask |= genev_xlat[i].sys_mask;
+ }
+}

Return to:

Send suggestions and report system problems to the System administrator.