File: ChangeLog

package info (click to toggle)
direvent 5.4-0.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,336 kB
  • sloc: sh: 21,812; ansic: 15,962; lex: 2,398; yacc: 1,439; makefile: 387; perl: 286; awk: 55; sed: 16
file content (1924 lines) | stat: -rw-r--r-- 61,156 bytes parent folder | download
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
2024-07-02  Sergey Poznyakoff  <gray@gnu.org>

	Version 5.4

2024-06-25  Sergey Poznyakoff  <gray@gnu.org>

	Update copyright years; clean up whitespace.

	Avoid race condition on a delete event.

	* src/direvent.c (main): Call synthetic_event_flush in the main loop.
	* src/direvent.h (synthetic_event_enqueue)
	(synthetic_event_update)
	(synthetic_event_flush)
	(evtxor): New macros.
	* src/ev_inotify.c (process_event): Call synthetic_event_update before
	running handlers.
	* src/ev_kqueue.c: Likewise.
	* src/event.c (evtxor): New function.
	* src/watcher.c (watchpoint_install_sentinel): Avoid race condition
	that occurs if a file is re-created between deleting it and installing
	a sentinel.
	(synthetic_event_enqueue)
	(synthetic_event_update)
	(synthetic_event_flush): New functions.

2024-06-24  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes

	* src/handler.c (handler_list_remove): Unref hp when removing it
	from the list.
	* src/progman.c (prog_handler_run): Improve diagnostics; avoid
	memory leak.
	* src/watcher.c (watchpoint_init): Remove original watchpoint
	to maintain its reference count.

2024-06-22  Sergey Poznyakoff  <gray@gnu.org>

	Keep track of the number of running handler instances.

	* NEWS: Document changes.
	* doc/direvent.texi: Document the max-instances statement.
	* src/config.c (cb_option): Change handing of wait/nowait options.
	(watcher_kw): New statement: max-instances.
	* src/direvent.h (HF_NOWAIT): Remove. Define HF_WAIT instead. This
	fixes the 'nowait' default.
	(prog_handler): New fields: max_count, run_count.
	* src/progman.c (process): New field: hp.
	(register_process): Take a pointer to the prog_hander as argument.
	Initialize the hp->field.
	(deregister_process): Remove unused function.
	(process_cleanup): Decrease run_count.
	(prog_handler_run): Keep track of the number of running instances.

	Use getgrouplist if available

2024-06-21  Sergey Poznyakoff  <gray@gnu.org>

	Upgrade to newer autoconf and grecs

	* acinclude.m4: Remove.
	* configure.ac: Upgrade for autoconf 2.71.
	* grecs: Upgrade.

	Upgrade grecs

	Revamp directory splitting.

	Until now, splitting a watcher dirname into directory and filename
	components was performed in-place, restoring the original dirname
	when no longer needed.  This caused grief when installing sentinels
	for removed files: if the full file name and its directory part
	yielded the same hash in grecs_symtab_lookup_or_install called from
	watchpoint_install, the original watchpoint would be returned instead
	of creating a new one.  Consequently, the created sentinel would never
	be able to catch file creation.

	* NEWS: Version 5.3.90
	* configure.ac: Likewise.
	* src/direvent.h (watchpoint): New fields: split_dirname, split_filename.
	Remove split_p.
	(split_pathname, unsplit_pathname): Remove protos.
	(watchpoint_extract_filename): New proto.
	* src/ev_inotify.c: Use watchpoint_extract_filename intstead of the
	removed split/unsplit functions.
	* src/ev_kqueue.c: Likewise.
	* src/watcher.c (watchpoint_unref): Free split_dirname and split_filename.
	(watchpoint_install_sentinel): Use watchpoint_extract_filename.
	(split_pathname, unsplit_pathname): Remove.
	(watchpoint_extract_filename): New function.
	* tests/genfile.c (main): Fix improper variable use.

2024-05-28  Sergey Poznyakoff  <gray@gnu.org>

	Fix bug in generic to system event translation

	* src/event.c (evtrans_gen_to_sys): Include original sys_mask bits as well.

2022-01-02  Sergey Poznyakoff  <gray@gnu.org>

	Update copyright year

2021-12-30  Sergey Poznyakoff  <gray@gnu.org>

	Fix typo in doc/webdoc.init

	Version 5.3

	Minor changes

	* doc/.gitignore: Update.
	* tests/shell.at: Force /bin/sh as the shell

2021-12-29  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix

	Unify text of copyright headers

	Fix building online docs

	Update documentation.  Version 5.2.90

2021-12-27  Sergey Poznyakoff  <gray@gnu.org>

	Don't pollute the environment with macro variables.

	* src/config.c (cb_global_environ): Remove unused local variable.
	Disallow legacy syntax.
	* src/progman.c (defenv): Change structure fields.
	(parse_legacy_env): Update accordingly.
	(runcmd): Define macro names as environment variables while processing
	the "environ" configure statements and undefine them afterwards.  If
	"shell" option is set, expand only macro variables in command names,
	otherwise expand both environment and macro variables.

2021-12-26  Sergey Poznyakoff  <gray@gnu.org>

	New configuration statement for manipulating the environment.

	The "environ" statement is now a compound statement. It can contain five
	kinds of substatements: "clear" to clear the environment, "keep" to retain
	certain variables while clearing the environment, "set" to set a variable,
	"unset" to unset a variable or variables, and "eval" to evaluate a variable
	reference for side effects.

	Both "keep" and "unset" can take globbing pattern as their argument,
	in which case they affect all variables matching that pattern.

	The value part in the "set" statement is subject to variable expansion,
	e.g.

	    set "MANPATH=$MANPATH${MANPATH:+:}/usr/local/man"

	The "environ" block can appear in global context as well.  In this case it
	applies to all watchers.

	The support for the old one-line "environ" statement is retained for
	backward compatibility.

	* grecs: Upgrade.
	* src/Makefile.am: Add new files.
	* src/envop.c: New file (fromGNU pies).
	* src/envop.h: Likewise.
	* src/wildmatch.c: Likewise.
	* src/config.c: Add support for block "environ" statement, both global
	and watcher-scope.
	Turn off concatenation of adjacent string literals.
	* src/direvent.h: Include envop.h
	(prog_handler): Remove env.  New field envop.
	(prog_handler_envrealloc): Remove.
	(direvent_envop): New global.
	* src/environ.c: Remove.
	* src/progman.c (parse_legacy_env): New function.
	(runcmd): Rewrite.
	(prog_handler_envrealloc): Remove.
	* tests/Makefile.am: Add new testcases.
	* tests/testsuite.at: Likewise.
	* tests/env00.at: New file.
	* tests/env01.at: New file.
	* tests/env02.at: New file.
	* tests/env03.at: New file.
	* tests/env04.at: New file.
	* tests/env05.at: New file.
	* tests/env06.at: New file.
	* tests/envdump.c: New options: -A and -D.
	* tests/envleg00.at: New file (renamed from env00.at).
	* tests/envleg01.at: New file (renamed from env01.at).
	* tests/envleg02.at: New file (renamed from env02.at).
	* tests/envleg03.at: New file (renamed from env03.at).
	* tests/shell.at: Use backslash continuation instead of
	relying on implicit concatenation of adjacent string literals.

2021-12-25  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite event formatting and logging functions

	* src/direvent.c (trans_stat, flags_format, ev_format): New functions.
	(ev_log): Rewrite.
	* src/direvent.h (ev_format): New prototype.
	(ev_log): Change prototype.
	* src/ev_inotify.c (process_event): Use new logging functions.
	* src/ev_kqueue.c: Likewise.
	* src/progman.c (runcmd): Use ev_format to format values for genev_name
	and sysev_name.

	Minor changes in progman

	Mostly terminology issues: "redirector" process renamed to "logger".

2021-12-24  Sergey Poznyakoff  <gray@gnu.org>

	Change interface for bulk closing of fds

	* configure.ac: Select interface to use for bulk closing of the open
	file descriptors.
	* src/Makefile.am: Add closefds.c
	* src/closefds.c: New file.
	* src/direvent.h (close_fds): New proto.
	* src/progman.c: Use new close_fds.

	Fix tracking of file changed status for inotify.

	* src/direvent.h (watchpoint): Remove the written field.
	[IFACE_KQUEUE] New field file_changed.
	[IFACE_INOTIFY] New field files_changed.
	* src/ev_inotify.c (file_changed): New function.
	(process_event): Use file_changed to verify file status.
	* src/ev_kqueue.c (sysev_add_watch,process_event): written renamed to
	file_changed.
	* src/watcher.c (watchpoint_unref) [IFACE_INOTIFY]: Deallocate
	files_changed.

	Various fixes.

	* src/direvent.c (nomem_abend): New function.
	(emalloc,ecalloc,erealloc): Use nomem_abend on out of memory
	error.
	* src/direvent.h (nomem_abend): New proto.
	* src/ev_inotify.c (process_event): The "changed" generic event
	includes creation of the file.
	Add missing gettext markers.
	Don't process events generated for the watchpoint directory itself.
	* src/ev_kqueue.c: Add missing gettext markers.
	* src/progman.c: Revamp debug messages.
	* src/watcher.c (watchpoint_filemask): New function.
	(watchpoint_install): Call nomem_abend on out of memory
	error.
	(watchpoint_suspend): Stop the program if unable to install sentinel.
	(directory_sentinel_handler_run,watch_subdirs): Use watchpoint_filemask.

2021-12-23  Sergey Poznyakoff  <gray@gnu.org>

	Remove debugging messages

	Linux support for the new event handling.  Follows up 048e7379d116

	* src/direvent.h (watchpoint) <written>: Move out of preprocessor
	conditional.
	* src/ev_inotify.c (genev_xlat): GENEV_WRITE maps to GENEV_WRITE.
	(sysev_add_watch): If GENEV_CHANGE is requested, raise
	IN_MODIFY and IN_CLOSE_WRITE.
	(process_event): Translate system events to generic event mask
	prior to distributing the event to handlers.
	* src/progman.c (close_fds): One more fix.  See also cba6578a56
	* tests/change.at: New testcase.
	* tests/Makefile.am: Add change.at
	* tests/testsuite.at: Include change.at
	* tests/createrec2.at: Reorder options to genfile.
	* tests/genfile.c: Accept multiple -s and -t options.

2021-12-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite event handling.  Introduce compound events ("change").  BSD-only.

	* src/config.c (cb_watcher): Use evtfill.
	* src/direvent.c (trans_fullmask): New function.
	(genev_init): Remove.  All references changed.
	* src/direvent.h (GENEV_CHANGE): New generic event.
	(handler_matches_event): Remove macro.
	(defevt,event_mask_init,evtsetall,genev_xlat): Remove declarations.
	(evtempty,evtfill)
	(evtrans_sys_to_gen,evtrans_gen_to_sys)
	(trans_fullmask): New protos.
	(watchpoint_run_handlers): Change signature.
	* src/ev_kqueue.c (genev_xlat): Change GENEV_WRITE translation.
	(sysev_add_watch): Change computation of sysmask.
	(process_event): Translate system event flags to generici event mask
	prior to distributing the event to handlers.
	Don't call user handlers for directories.
	* src/event.c (getevt): Rewrite.
	(defevt,event_mask_init): Remove.
	(evtempty,evtfill,evtand,evtrans_sys_to_gen)
	(evtrans_gen_to_sys): New functions.
	(genev_transtab): Declare the "change" event.
	* src/handler.c (watchpoint_run_handlers): Take event_mask as argument.
	Change logic accordingly.
	* src/watcher.c (deliver_ev_create): Use evtand and filpatlist_match
	explicitly, instead of the removed handler_matches_event.

2021-12-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove unnecessary field of struct watcher.

	* src/direvent.h (watcher): Remove watch_written.
	* src/ev_kqueue.c (sysev_add_watch,process_event): Update accordingly.

2021-12-21  Sergey Poznyakoff  <gray@gnu.org>

	Remove spurious comma

2021-12-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix test sent.at on Linux

	Minor fix

	* src/ev_kqueue.c (process_event): Protect the use of NOTE_CLOSE_WRITE
	with #ifdef.

	Bugfixes (mostly BSD-related)

	* src/direvent.h (watchpoint): Remove file_mode.
	* src/ev_kqueue.c (sysev_add_watch): Actually register new event to
	minimize the race condition window.
	(check_created): Check for error if readdir returns NULL.
	(process_event): Check for new files and directories after running
	event handlers.
	* src/progman.c (close_fds): Bugfix.  Start from the highest possible fd.
	(open_redirector): Fix loop condition.
	* src/watcher.c (watch_subdirs): Check for error if readdir returns NULL.
	* tests/listname: New auxiliary script.
	* tests/Makefile.am: Distribute listname.
	* tests/createrec.at: Rewrite test.  Use the listname script to monitor
	and govern it.
	* tests/createrec3.at: Likewise.

2021-12-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update grecs

	Change handling of GENEV_CREATE on FreeBSD

	* src/direvent.h (event_handler_fn): Additional argument: notify.
	(watchpoint) [USE_IFACE == IFACE_KQUEUE]: New members: watch_written,
	written.
	* src/ev_kqueue.c (sysev_transtab): Define more system events (if
	defined).
	(genev_xlat): Depending on whether NOTE_CLOSE_WRITE is defined,
	change GENEV_WRITE translation.
	(sysev_add_watch) [NOTE_CLOSE_WRITE]: Initialize written and watch_written.
	Update sysmask.
	(process_event): Special handling for watch_written!=0
	* src/handler.c (watchpoint_run_handlers): Pass notify (1) to hp->run.
	* src/progman.c (prog_handler_run): New argument: notify.  Do nothing
	if it's 0.
	* src/watcher.c (sentinel_handler_run): New argument: notify.  Pass it
	deliver_ev_create.
	(directory_sentinel_handler_run): New argument: notify.  Pass it
	to watch_subdirs.
	Call watchpoint_attach_directory_sentinel if using IFACE_KQUEUE.
	(deliver_ev_create): Pass notify to hp->run.

	* tests/createrec3.at: New test.
	* tests/genfile.c: New program.
	* tests/Makefile.am: Add createrec3.at
	(noinst_PROGRAMS): Add genfile.
	* tests/createrec2.at: Use genfile with 1 second delay.
	* tests/sent.at: Update expected output.
	* tests/testsuite.at: Add genfile.

2021-12-20  Sergey Poznyakoff  <gray@gnu.org>

	Upgrade grecs (fixes grecs_symtab_foreach)

	Rewrite the recursive watching support

	* src/config.c (eventconf_flush): Attach directory sentinel
	when recursive whatching is enabled or when using IFACE_KQUEUE
	* src/direvent.h (handler) <notify_always>: New member.
	(recent_head): New type.
	(watchpoint) <rhead>: New member.
	(check_new_watcher): Remove.
	(watchpoint_attach_directory_sentinel): New proto.
	(deliver_ev_create): Change signature.
	(watchpoint_recent_init)
	(watchpoint_recent_deinit)
	(watchpoint_recent_lookup)
	(watchpoint_recent_cleanup): New protos.
	(handler_list_append_cow)
	(handler_list_remove_cow): New protos.
	* src/ev_inotify.c (process_event): When a IN_CREATE is received,
	first check if the created file is in the recent file list (rhead).
	If so, don't deliver the event.  This avoids spurious create events.
	* src/ev_kqueue.c (sysev_filemask): Always return S_IFMT.
	(check_created): Deliver the create event.  Remove call to
	subwatcher_create.  The create event will trigger creation of new
	watchpoints.
	* src/handler.c (handler_list_dup): New function.
	(handler_list_append_cow)
	(handler_list_remove_cow): New copy-on-write interfaces.
	* src/progman.c (process_timeouts): Initialize alarm_time with the
	return from watchpoint_recent_cleanup.  Initialize the notify_always
	member of the struct handler.
	* src/watcher.c (watchpoint_unref): De-initialize the recent object
	list.
	(watchpoint_destroy): Likewise.
	(watchpoint_recent_init)
	(watchpoint_recent_deinit)
	(watchpoint_recent_lookup)
	(watchpoint_recent_cleanup): New functions.  Maintain the list of
	recent objects.
	(watchpoint_install_sentinel): Set notify_always.
	(directory_sentinel_handler_run)
	(watchpoint_attach_directory_sentinel): New functions.
	(watchpoint_init): Don't enforce create event if recursive watching is
	enabled.
	(subwatcher_create,check_new_watcher): Remove.
	(deliver_ev_create): New argument: notify.
	(watch_subdirs): Rewrite.
	* tests/createrec2.at: Re-insert delays between directory and file
	creation.

2021-12-09  Sergey Poznyakoff  <gray@gnu.org>

	Out of band events considered a failed experiment

	This also makes createrec2.sh pass on BSD systems

	* src/direvent.h: Remove GENEV_OOB
	* src/event.c (genev_transtab): Likewise.
	* src/ev_kqueue.c (check_created): Set a subwatcher only if
	parent watcher depth is not 0.
	* src/watcher.c (deliver_ev_create) Revert previous commit.
	(watch_subdirs): Clear S_IFDIR bit if parent depth is 0.

2021-12-08  Sergey Poznyakoff  <gray@gnu.org>

	Mark generated CREATE events as out of band.

	Deliver such events to each handler that receives CREATE and WRITE
	events.  This makes sure all handler have a chance to notice creation
	of a file within the time that expires between  creation of a directory
	and creation of a watchpoint for it.  Introduce new marker (flag) for
	such out of band data.

	Make sure out of band CREATE notifications are sent to the deepest
	created watchpoint, in case the recursion depth is limited.

	* src/direvent.h (GENEV_OOB): New macro for out of band events.
	* src/event.c (genev_transtab): Add an entry for GENEV_OOB.
	* src/watcher.c (deliver_ev_create): Deliver out of band CREATE
	event.  Receipients are all handlers that requested CREATE or WRITE
	events.
	(check_new_watcher): Fix misleading comment.
	(watch_subdirs):  Make sure out of band CREATE notifications are sent
	if the watchpoint has zero depth (last directory in a depth-limited
	recusive watchpoint chain).
	* tests/createrec2.at: Remove sleeps between creation of a directory
	and creation of a file in it.

	Format $genev_name in accordance with the documentation.

	I.e., if several events are reported, $genev_name contains a
	whitespace-delimited list of event names.

	* src/progman.c (runcmd): use trans_tokfirst/trans_toknext to format
	genev_name.

	Test recursion depth limit.

	testsuite: don't use syslog

2021-01-06  Sergey Poznyakoff  <gray@gnu.org>

	Update copyright years

2020-07-08  Sergey Poznyakoff  <gray@gnu.org>

	Fix handler reference count

	* src/handler.c: Fix condition

2020-07-06  Sergey Poznyakoff  <gray@gnu.org>

	Fix recursive watchers.

	Recursive watchers silently assumed that the "create" generic event
	was configured for the watcher.  If it wasn't the case, the watcher
	failed to catch mkdir events and install subwatchers.  This patch
	fixes it.

	* src/watcher.c (watchpoint_init): Register the create event if
	recursive watching is requested.

2020-06-29  Sergey Poznyakoff  <gray@gnu.org>

	Upgrade grecs to fix parallel builds

2020-06-28  Sergey Poznyakoff  <gray@gnu.org>

	Use grecs eb98370ae0 to fix bison 3.6.4 warnings

2020-06-14  Sergey Poznyakoff  <gray@gnu.org>

	Use grecs with wordsplit v1.1

2019-07-13  Sergey Poznyakoff  <gray@gnu.org>

	Version 5.2

2019-07-10  Sergey Poznyakoff  <gray@gnu.org>

	Switch to grecs b06fb7d3

2016-08-25  Sergey Poznyakoff  <gray@gnu.org>

	Update the documentation

2016-08-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Get rid of hashtab.c, use symtab from grecs instead.

	* grecs: Pull new version.
	* src/hashtab.c: Remove.
	* po/POTFILES.in: Remove src/hashtab.c
	* src/Makefile.am (direvent_SOURCES): Remove hashtab.c
	* src/config.c (grecs_parser_options): Set GRECS_OPTION_QUOTED_STRING_CONCAT.
	* src/direvent.h: Remove hashtab prototypes.
	* src/event.c: Use grecs_symtab.
	* src/watcher.c: Likewise.

	Rename a test case

	* tests/Makefile.am: Update.
	* tests/testsuite.at: Update.
	* tests/conv.at: Rename to tests/file.at

	Fix new functionality on BSD hosts.  Some minor fixes.

	* src/direvent.c (main): Call watchpoint_gc in the main loop.
	* src/direvent.h (watchpoint) <isdir>: New member.
	(deliver_ev_create,subwatcher_create): Change signature.
	* src/ev_kqueue.c (sysev_add_watch): Always monitor NOTE_DELETE.
	(process_event): Special handling for file deletion.
	* src/handler.c (handler_list_remove): Return the number of elements
	remaining in the list.
	* src/hashtab.c (hashtab_remove): Ignore unexisting entries
	* src/progman.c (close_fds): Determine the highest used fd by
	dup'ing standard input.
	* src/watcher.c (watchpoint_install): Always increase refcnt.
	(watchpoint_gc_list): New variable.
	(watchpoint_gc): Iterate over watchpoint_gc_list deleting
	elements from it.
	(watchpoint_suspend): Install sentinels only for top-level
	watchpoints that were removed.
	(sentinel_handler_run): Deliver the create event.
	(watchpoint_install_sentinel): Monitor generic create event.
	(convert_watcher): Remove.
	(subwatcher_create): Remove the isdir parameter.
	(watch_subdirs): Exit early if the watchpoint is not a
	directory.
	(deliver_ev_create): Change signature.  Take both directory
	and file name as arguments. All uses changes.
	* tests/conv.at: Clear expected stderr.
	* tests/sent.at: Fix race condition.

	Add new tests + minor fixes.

	* src/direvent.h (filpatlist_is_empty): New proto.
	* src/fnpat.c (filpatlist_is_empty): New function.
	* src/watcher.c (convert_watcher): Fix error handling.
	(watchpoint_init): Remove spurious notice.

	* tests/conv.at: New test.
	* tests/sent.at: New test.
	* tests/Makefile.am: Add new tests.
	* tests/testsuite.at: Likewise.

	Further modify struct handler.

	Instead of accomodating two types of functionality, the new struct handler
	has a pointer to the function that is responsible for handling the event,
	and a pointer to data for that function (closure).  Additionally, a
	pointer to deallocator function is also provided.

	Existing functionality is reimplemented using this new struct.  New
	types of handlers can easily be added.

	* src/config.c (eventconf)<ev_mask,fpat,prog_handler>: New members
	<handler>: Remove.
	All uses changed.
	* src/direvent.h (filpatlist_t)
	(event_handler_fn, handler_free_fn): New data types.
	(handler): Remove union and type.  Add two pointer to functions
	that are to implement the functionality (run and free) and a pointer
	to data for them.
	(prog_handler): New struct.
	(prog_handler_alloc,prog_handler_free)
	(prog_handler_envrealloc)
	(watchpoint_run_handlers): New protos.
	(run_handler,filename_pattern_free)
	(filename_pattern_match): Remove
	(filpatlist_add, filpatlist_add_exact)
	(filpatlist_destroy, filpatlist_match): New protos.
	* src/ev_inotify.c (process_event): Use watchpoint_run_handlers
	* src/ev_kqueue.c: Likewise.
	* src/fnpat.c: Major rewrite.
	* src/handler.c (handler_copy)
	(handler_envrealloc,handler_add_pattern)
	(handler_add_exact_filename): Remove
	(handler_alloc): Change arguments.
	(watchpoint_run_handlers): New function.
	* src/progman.c (prog_handler_alloc)
	(prog_handler_envrealloc): New functions.
	* src/watcher.c: Reimplement sentinel watchers.

	Rename: struct dirwatcher -> struct watchpoint

	Implement sentinel handlers.

	Sentinel handlers wait for a creation of a directory.  When
	the target directory is created, the sentinel handler installs
	the actual handler for that directory and destroys itself.  Thus,
	basically sentinel handlers provide a way to defer setting a
	watchpoint on a directory until it is created.

	* src/handler.c: New source.
	* src/Makefile.am (direvent_SOURCES): Add handler.c
	* src/config.c: Move handler-specific stuff to handler.c
	* src/direvent.h: Rename direvent_handler_ to handler_
	(handler_free, handler_copy)
	(handler_envrealloc)
	(dirwatcher_init,dirwatcher_gc): New protos.
	(dirwatcher_install_ptr)
	(dirwatcher_install_sentinel): New protos.
	* src/ev_inotify.c (process_event): Special handling for
	IN_IGNORED.
	(sysev_select): Ignore signo==0.
	* src/hashtab.c (hashtab_remove): Add missing return statement.
	(hashtab_foreach): Break out of look instead of returning from
	it.
	* src/progman.c (run_sentinel): Implement.
	* src/watcher.c (+dirwatcher_install_ptr): New function.
	(dirwatcher_gc): New function.

	Bugfix

	* src/hashtab.c (hashent_list_append): Fix allocated memory size.

	Initial preparation for having distinct handler types.

	* src/direvent.h (pattern_type): New enum, instead of
	PAT_* defines.
	(filename_pattern): use enum pattern_type.
	(handler_type): New enum.
	(handler): Can be of two types: HANDLER_EXTERN, which handles
	external programs and is equivalent to the prior content of
	the structure, and HANDLER_SENTINEL, which is planned to be
	a built-in handler for configuring watchpoints for newly created
	directories. All uses changed.
	(dirwatcher) <refcnt>: Change type to size_t.
	(handler_alloc,handler_add_pattern)
	(handler_add_exact_filename): New protos.
	* src/hashtab.c: Provisions for safe adding and removing
	from the hashtable when iterating over it.
	(hashtab) <flags>: Removed.
	<itr_level, list_new, list_del>: New members.
	(hashtab_remove): When iterating, place pointer to the removed
	entry in list_del instead of actually removing it.
	(hashtab_lookup_or_install): When iterating, add a pointer to
	the newly created entry to the list_new list, instead of adding
	it immediately.
	(hashtab_foreach): Flush list_del and list_new at the end of
	the topmost iteration.

	* src/config.c (handler_alloc): Rename to handler_copy
	(handler_alloc): New function.
	(handler_free): Two types of handlers.
	(handler_add_pattern)
	(handler_add_exact_filename): New functions.
	(file_name_pattern): Takes struct handler * as its
	first argument.
	(cb_file_pattern): Change accordingly.
	* src/fnpat.c (filename_pattern_free): Handle PAT_EXACT.
	(filename_pattern_match): Likewise.
	* src/progman.c (run_handler): Two types of handlers.
	* src/watcher.c (dirwatcher_install): Restore missing gettext
	marker.
	Allocate handler_list.
	(dirwatcher_init): Convert non-directory watchpoints to directory
	ones.

2016-08-20  Sergey Poznyakoff  <gray@gnu.org>

	Fix environment modification code

	Port fixes from rush

2016-08-13  Sergey Poznyakoff  <gray@gnu.org>

	Clean-up handler initialization routines.

	In particular, this change allows for placing several environ statements
	in a single watcher statement.  Such environ statements accumulate.

	* src/config.c (eventconf): Simplify the structure.
	(handler_alloc): Take a pointer to struct handler as
	argument.
	(handler_envrealloc): New function.
	(handler_free): Rename to handler_listent_free. All uses updated.
	(handler_free): New function.
	(eventconf_flush,cb_option,cb_user): Reflect changes to struct
	eventconf
	(cb_environ): Likewise. Reallocate env as necessary.

	* doc/direvent.texi: Document the change.

	* NEWS: Document the changes.

	Limit memory usage.

	Don't create duplicates of handler structs for each pathname
	watched.  Instead keep a count of references to each handler
	and handler list and deallocate them when the count falls to
	zero.

	* src/config.c (direvent_handler_list): New struct.
	(direvent_handler_first,direvent_handler_next)
	(direvent_handler_current)
	(direvent_handler_list_create)
	(direvent_handler_list_copy)
	(direvent_handler_list_unref)
	(direvent_handler_list_append): New functions.
	(eventconf_flush): Create a single copy of watcher.
	* src/direvent.c (main): Call shutdown_watchers before terminating.
	* src/direvent.h (handler) <next>: Remove.
	<refcnt>: New member.
	<prog>: Remove const qualifier.
	(direvent_handler_list_t)
	(direvent_handler_iterator_t): New data types.
	(dirwatcher): Remove handler_tail. Change type of
	handler_list to direvent_handler_list_t.
	(shutdown_watchers)
	(direvent_handler_first,direvent_handler_next)
	(direvent_handler_current)
	(direvent_handler_list_create)
	(direvent_handler_list_copy)
	(direvent_handler_list_unref)
	(direvent_handler_list_append): New protos.
	(for_each_handler): New define.
	* src/watcher.c (dirwatcher_unref): Call direvent_handler_list_unref.
	(all functions): Use handler iterators where necessary
	(shutdown_watchers): New function.
	* src/ev_inotify.c: Use handler iterators.
	* src/ev_kqueue.c: Likewise.

	Fix comments

2016-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 5.1.90

	* NEWS: Update.
	* configure.ac: Update.
	* src/watcher.c (setwatcher): Fix conditional.
	* src/direvent.h (dirwatcher_pattern_match): Add missing prototype.

	Don't keep watchpoint descriptor table

	During the lifetime of a watcher, its descriptor can change, so
	it cannot be reliably used to identify the watcher outside of
	the ev_*.c module.  E.g. for kqueue interface, descriptors change
	after compacting the event table, which happens when a watcher is
	closed and removed.

	Finding the watcher for the given event is now the responsibility
	of the event module.

	* src/direvent.h (dirwatcher_ref)
	(dirwatcher_unref): New protos.
	(dirwatcher_lookup_wd): Remove.
	* src/watcher.c (dirwatcher_ref): New function.
	(dirwatcher_register, dirwatcher_lookup_wd)
	(dirwatcher_remove_wd): Remove.  All uses updated.
	(setwatcher): Indicate successful initialization for
	the caller.
	(setup_watchers): Check success flag.
	* src/ev_inotify.c (dwreg, dwunreg)
	(dwget): New functions to keep track of the registered
	watchers and their descriptors.
	(sysev_add_watch): Register watcher.
	(sysev_rm_watch): Deregister it.
	* src/ev_kqueue.c (check_created): Skip directory entries
	that don't match pattern.

2016-08-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes

	* src/Makefile.am (AM_CPPFLAGS): Define SYSCONFDIR.
	* src/direvent.c (mkfilename): Don't append trailing /
	if filename is empty.
	* src/direvent.h (hashtab_count_entries): Remove.
	* src/ev_inotify.c (process_event): Translate IN_IGNORED to IN_DELETE.
	Remove the watcher only after all handlers have been invoked.
	* src/hashtab.c (hashtab) <elcount>: New member. Keep the number
	of actually used elements.
	(hashtab_remove, hashtab_lookup_or_install)
	(hashtab_create,hashtab_clear): Keep track of the number of
	actually used elements.
	(hashtab_count_entries): Remove duplicate function.
	(hashtab_count): Return elcount without recomputing.
	* src/watcher.c (texttab): Rename to nametab for clarity.
	(dirwatcher_pattern_match): New function.
	(watch_subdirs): Ignore subdirs that don't match file name
	pattern.
	(dirwatcher_destroy): Exit immediately if no more watchers
	are left.

2016-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 5.1

2016-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove unused variables

	Use latest commit of grecs

	Update copyright years

2016-06-20  Sergey Poznyakoff  <gray@gnu.org>

	Update grecs

	Make sure descriptor 0 is allocated before calling detach.

	* grecs: Upgrade to 9161098.

	Bugfix

	* configure.ac (INCLUDE_PATH_ARGS): Quote definition for shell

	Implement search path for #include and #include_once.

	* src/Makefile.am (AM_CPPFLAGS): Define INCLUDE_PATH_ARGS
	* src/cmdline.opt: New option --include-directory (-I).
	(help_hook): Print the actual content of the include search path.
	* src/config.c (config_finish): Remove.
	(config_init): New function. Set up include search path.
	(config_parse): New function.
	* src/direvent.c (main): Call config_init and config_parse.
	* src/direvent.h (config_finish): Remove.
	(config_init,config_parse): New proto.

	* grecs: Upgrade.

	* NEWS: Document changes.
	* README: Document the --with-include-path option.
	* configure.ac: New option --with-include-path.
	* doc/direvent.8: Document the -I option and include search paths.
	* doc/direvent.conf.5: Document include search paths.
	* doc/direvent.texi: Document the -I option and include search paths.

2016-06-18  Sergey Poznyakoff  <gray@gnu.org>

	New option to invoke handlers via /bin/sh

	* src/config.c (cb_option): New option 'shell'.
	* src/direvent.h (HF_SHELL): New flag.
	* src/progman.c (runcmd): Optionally run program via /bin/sh
	* NEWS: Mention new option.
	* doc/direvent.conf.5: Document the 'shell' option.
	* grecs: Update.
	* tests/shell.at: New test case.
	* tests/Makefile.am: Add new test.
	* tests/testsuite.at: Add new test.

	Globbing patterns in #include and #include_once

	* grecs: Update.
	* src/direvent.c (main): Allocate tag to avoid coredump if
	redefined in the config.
	* tests/re05.at: Escape backslash.
	* NEWS: Update.
	* doc/direvent.conf.5: Update.
	* doc/direvent.texi: Update.

2015-04-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix doc generation.

	Default Config file applied to all output formats, which is wrong.
	Use a dedicated configuration file for html output formats, and
	defaults for the rest.

	* doc/Makefile.am (GENDOCS): Add html-specific configuration file.
	* doc/Config: Rename to doc/html.init (with changes).

2015-04-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 5.0.90

2015-03-01  Sergey Poznyakoff  <gray@gnu.org>

	Switch to Texinfo 5.0

	* doc/Config: Rewrite.
	* doc/Makefile.am: Use Makeinfo 5 instead of texi2htm
	* doc/gendocs_template: Ps is not built
	* imprimatur: Upgrade.

2014-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor documentation fixes.

	* doc/direvent.8: Escape dashes in examples.
	* doc/direvent.conf.5: Likewise.
	* doc/direvent.texi: Reword copyright statement (part about covers).

2014-09-06  Sergey Poznyakoff  <gray@gnu.org>

	Version 5.0

2014-09-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add new test

	* tests/samepath.at: New file.
	* tests/Makefile.am: Add new testcase.
	* tests/testsuite.at: Likewise.

	* NEWS: Update
	* README: Update

2014-09-01  Sergey Poznyakoff  <gray@gnu.org>

	Version 4.1.91

	Improve I18N

	* po/POTFILES.in: Add grecs sources.
	* src/Makefile.am (AM_CPPFLAGS): Add the definition of LOCALEDIR.
	* src/cmdline.opt (help_hook): Add missing gettext markers.
	* src/direvent.c (maint): Initialize libintl

2014-09-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve and document self-test mode

	* src/direvent.c (self_test): Run the program as /bin/sh -c program.
	* doc/direvent.texi: Document self-test mode and missing options.
	* doc/direvent.8: Document self-test.
	* doc/direvent.conf.5: Likewise.
	* src/cmdline.opt: Fix option declarations.

2014-09-01  Sergey Poznyakoff  <gray@gnu.org>

	bootstrap: add option to get update po files and exit

2014-08-31  Sergey Poznyakoff  <gray@gnu.org>

	Accept multpile watchers for the same path

	* src/direvent.h (dirwatcher)<handler_tail>: New member.
	* src/config.c (eventconf_flush): Use handler_tail to update
	the handler list.
	Remove erroneous check.

2014-08-27  Sergey Poznyakoff  <gray@gnu.org>

	Minor changes

	* src/direvent.c (get_user_groups): Fix typo in a diagnostic
	message.

	bootstrap: download po files

2014-08-25  Sergey Poznyakoff  <gray@gnu.org>

	Update NEWS

	Upgrade grecs

	I18N

	* .gitignore: Add am
	* bootstrap: Create am, unless exists.
	* Makefile.am (SUBDIRS): Add po
	* acinclude.m4: New file.
	* configure.ac: Use gettext
	* doc/direvent.texi: Update
	* po/.gitignore: New file
	* po/POTFILES.in: New file.
	* po/Makevars: New file.
	* src/Makefile.am (LDADD): Add @LIBINTL@
	(noinst_HEADERS): Add gettext.h
	* src/config.c: gettextize
	* src/direvent.c: Likewise.
	* src/environ.c: Likewise.
	* src/hashtab.c: Likewise.
	* src/progman.c: Likewise.
	* src/watcher.c: Likewise.
	* src/gettext.h: New file.

	* src/direvent.h: Add missing prototypes.
	* tests/re05.at: Remove superfluous quoting.

2014-08-22  Sergey Poznyakoff  <gray@gnu.org>

	Update docs

2014-08-21  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix in docs

	Direvent is dubbed GNU program

	* configure.ac: Change package name to GNU Direvent
	* doc/direvent.8: Reflect we are GNU
	* doc/direvent.texi: Likewise.
	* src/cmdline.opt: Likewise.

2014-08-17  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite testsuite.

	Get rid of the kludgy waitpid; use the built-in self-test mode instead.

	* src/cmdline.opt: New option --self-test.
	* src/direvent.c (self_test_prog,self_test_pid)
	(exit_code): New globals.
	(self_test): New function.
	(main): Call self_test if required.
	If stop is set, break the loop immediately.
	Return exit_code.
	* src/direvent.h (stop,self_test_pid,exit_code): New externs.
	* src/environ.c (environ_setup): Always define DIREVENT_SELF_TEST_PID
	when in self-test mode.
	* src/progman.c (process_cleanup): Special handling for termination of
	the self-test script.
	(runcmd): Define self_test_pid envvar in self-test mode.
	* tests/Makefile.am: Remove waitpid.
	* tests/waitfile.c: Removed.
	* tests/printname: Send HUP to the self-test PID if sentinel file is created.
	* tests/envdump.c (read_pid_and_sig): Restore arg to its pristine state
	before exiting.
	* tests/testsuite.at (AT_DIREVENT_TEST): New macro.

	* tests/attrib.at: Rewrite using AT_DIREVENT_TEST.
	* tests/cmdexp.at: Likewise.
	* tests/create.at: Likewise.
	* tests/createrec.at: Likewise.
	* tests/delete.at: Likewise.
	* tests/env00.at: Likewise.
	* tests/env01.at: Likewise.
	* tests/env02.at: Likewise.
	* tests/env03.at: Likewise.
	* tests/glob01.at: Likewise.
	* tests/glob02.at: Likewise.
	* tests/re01.at: Likewise.
	* tests/re02.at: Likewise.
	* tests/re03.at: Likewise.
	* tests/re04.at: Likewise.
	* tests/re05.at: Likewise.
	* tests/write.at: Likewise.
	*   grecs (untracked content)

	Rename project to direvent.

2014-08-10  Sergey Poznyakoff  <gray@gnu.org>

	Version 4.1.90

	* NEWS: Change version number
	* configure.ac: Likewise.
	* doc/dircond.conf.5: Update copyright years.
	* doc/dircond.texi: Update copyright years.
	* src/config.c: Update copyright years.
	* src/dircond.h: Update copyright years.
	* src/fnpat.c: Update copyright years.
	* tests/envdump.c: Update copyright years.

2014-07-29  Sergey Poznyakoff  <gray@gnu.org>

	Introduce pattern negation.

	* doc/dircond.conf.5: Document negated patterns.
	* doc/dircond.texi: Likewise.
	* src/config.c (file_name_pattern): A ! in front of a pattern
	indicates negation.
	* src/dircond.h (filename_pattern)<neg>: New member.
	* src/fnpat.c: Honor neg member.
	* tests/envdump.c (main): don't depend on the order of command
	line options.
	* tests/glob02.at: New test case.
	* tests/re05.at: Likewise.
	* tests/Makefile.am: Add new files.
	* tests/testsuite.at: Include new testcases.

2013-12-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove trailing tabs in doc/dircond.8

	Update gendocs_template

	Update dircond.conf.5

	Version 4.1

	* NEWS: Document new release.

	* Makefile.am
	* configure.ac: Enable silent rules. Set version number 4.1
	* doc/Makefile.am: Add copyleft header.
	* src/Makefile.am: Likewise.
	* tests/Makefile.am: Add missing silent rule markers.

	Fix documentation of the "file" statement.

	Implement filename selection

	* NEWS: Update.
	* doc/dircond.texi: Document the file statement.
	* src/fnpat.c: New file.
	* src/Makefile.am (dircond_SOURCES): Add fnpat.c
	* src/config.c (eventconf) <fnames>: New member.
	(eventconf_free): Free fnames.
	(eventconf_flush): Set fnames.
	(watcher_kw) <file>: New statement.
	* src/dircond.h (filename_pattern): New struct.
	(handler) <fnames>: New member.
	(handler_matches_event): New macro.
	(filename_pattern_free)
	(filename_pattern_match): New proto.
	* src/ev_inotify.c (process_event): Use handler_matches_event.
	* src/ev_kqueue.c: Likewise.
	* src/watcher.c (deliver_ev_create): Likewise.

	* tests/Makefile.am: Add new tests.
	* tests/testsuite.at: Likewise.
	* tests/create.at: Add a distinctive keyword.
	* tests/glob01.at: New testcase.
	* tests/re01.at: New testcase.
	* tests/re02.at: Likewise.
	* tests/re03.at: Likewise.
	* tests/re04.at: Likewise.

2013-12-17  Sergey Poznyakoff  <gray@gnu.org>

	Upgrade grecs

2013-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix the testsuite, bump version number

	* configure.ac: Update version number.
	* NEWS: Update version number.
	* tests/Makefile.am: Distribute printname.
	* tests/printname: New file.
	* tests/atlocal.in (SRCDIR): New variable.
	* tests/createrec.at: Fix path to printname.

2013-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Generate genev_create event for subdirectories.

	A genev_create event is generated for all files and directories below the
	newly created one, if required by the configuration.  At the same time, new
	watchers are installed.  This is illustrated by the testcase "createrec.at",
	which version 4.0 wouldn't pass, because it incorrectly assumed that a
	notification would arrive for each subdirectory or subfile, once the watcher
	is installed for the parent directory.

	* src/watcher.c (subwatcher_create): Return integer.
	Take additional argument (notify).  If it is true, register
	watchers for the subdirectories.
	(deliver_ev_create): New function.
	(watch_subdirs): Return number of watchers installed or -1
	on error.
	(watch_pathname): Remove. All callers use subwatcher_create
	instead.
	* tests/Makefile.am: Add new test.
	* tests/testsuite.at: Likewise.
	* tests/attrib.at: Use pwd -P, instead of plain pwd.
	* tests/cmdexp.at: Likewise.
	* tests/create.at: Likewise.
	* tests/delete.at: Likewise.
	* tests/env00.at: Likewise.
	* tests/env01.at: Likewise.
	* tests/env02.at: Likewise.
	* tests/env03.at: Likewise.
	* tests/write.at: Likewise.

2013-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes in the docs.

2013-06-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix typos in manpages

	Update scripts for generating documentation output.

2013-06-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update dircond manpage

	Finish the docs. Set version number 4.0. Change bug-report address.

	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.

	inotify: fix definition of the generic write event

	* src/ev_inotify.c (genev_xlat): Translate IN_MODIFY|IN_CLOSE_WRITE
	to GENEV_WRITE.

	Update docs

2013-06-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Reorganize namespace.

	Revamp initialization system in a cleaner way.

	* src/Makefile.am: Use the proper detach-*.c source depending
	on the configuration output.
	* src/rdaemon.c: Remove.
	* src/detach-std.c: New file.
	* src/detach-bsd.c: New file.
	* src/detach-darwin.c: New file.
	* src/dircond.c (signal_setup): Use sigv_set_all.
	(sigmain): Do not reinstall the handler.
	(main): Use detach() instead of daemon().
	* src/dircond.h (detach): New proto.
	(NITEMS): New macro.
	(sigv_set_action, sigv_set_all)
	(sigv_set_tab, sigv_set_action_tab): New protos.
	* src/sigv.c: New file.
	* tests/waitfile.c: Remove unused variable.
	* doc/dircond.8: Update.
	* doc/dircond.texi: Update.

	Improve docs

2013-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix a copy-paste error.

	Write the docs in manpage format:

	* doc/.gitignore
	* doc/Makefile.am: Add rules for texinfo documents.
	* doc/dircond.1: Removed.
	* doc/dircond.8: New file.
	* doc/dircond.conf.5: New file.
	* doc/dircond.texi: New file (a placeholder).
	* doc/fdl.texi: New file.
	* doc/gendocs_template: New file.

	Rename event variables and the corresponding environment
	ones:

	* src/environ.c
	* src/dircond.c
	* src/progman.c
	* tests/.gitignore
	* tests/attrib.at
	* tests/cmdexp.at
	* tests/create.at
	* tests/delete.at
	* tests/env00.at
	* tests/env01.at
	* tests/env03.at
	* tests/remove.at
	* tests/write.at

2013-06-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix

	* src/dircond.c (vdiag): Fix memory allocation

	Uograde grecs

	Upgrade grecs

	Initial support for Darwin.

	Basically the same as BSD, except that it lacks rfork, which
	makes it impossible to initialize watchers before daemonizing.

	* configure.ac: Check for rfork, define the DIRCOND_FORK conditional
	if present.
	* src/Makefile.am [DIRCOND_KQUEUE][DIRCOND_RFORK]: Add rdaemon.c
	to the sources.
	* src/dircond.c: Define INIT_EARLY if it is safe to initialize
	the event system before forking.  Currently the only supported
	system that's not capable of that is Darwin.
	(main): Call setup_watchers conditionally, before or after the
	call to daemon.
	Move call to evsys_init to setup_watchers.
	Reorganize the main loop.
	* src/dircond.h (event_mask_init): Change signature. The third
	argument specifies which mask bits we're interested in.
	All uses changed.
	* src/event.c: Ditto.
	* src/watcher.c (setup_watchers): Call evsys_init.

	Test environment modifications.

	* src/config.c (cb_environ): Accept list argument.
	* tests/Makefile.am: Add new tests.
	* tests/testsuite.at: Add new tests.
	* tests/env00.at: New file.
	* tests/env01.at: New file.
	* tests/env02.at: New file.
	* tests/env03.at: New file.

	Test command line expansions.

	* envdump.c: Accept unrecognized command line parameters.
	Use -f option to redirect output to a file. All uses updated.
	* cmdexp.at: New file.
	* Makefile.am: Add cmdexp.at
	* testsuite.at: Include cmdexp.at

	Fix CREATE detection with kqueue.

	* src/ev_kqueue.c (check_created): Fall back to hash lookup
	to see if the file is recently created.
	* tests/create.at: Remove the sleep. Wait for the pidfile to
	appear before proceding with the test.
	* tests/delete.at: Wait for the pidfile to appear before
	proceding with the test.
	* tests/remove.at: Likewise.
	* tests/write.at: Likewise.

	Minor fixes.

	Minor fixes

	Fix daemon mode on BSD. Provide a testsuite.

	* configure.ac: Initialize the testsuite.
	* src/Makefile.am [DIRCOND_KQUEUE] (dircond_SOURCES): Add rdaemon.c
	* src/rdaemon.c: New file.
	* src/cmdline.opt: New option -l.
	* src/config.c (get_priority): New function.
	* src/dircond.c (log_to_stderr): New variable.
	(vdiag): Optionally output the message both to
	stderr and syslog.
	(stop): New global.
	(sigmain): Set stop.
	(main): Initialize logging early.
	Loop until stop is set.
	Remove pidfile before returning.
	* src/dircond.h (read_facility): Remove.
	(get_facility,get_priority): New protos.
	* src/ev_kqueue.c (evsys_select): Fix error handling.
	* tests/.gitignore: New file.
	* tests/Makefile.am: Provide autotest framework.
	* tests/atlocal.in: New file.
	* tests/attrib.at: New file.
	* tests/create.at: New file.
	* tests/delete.at: New file.
	* tests/remove.at: New file.
	* tests/testsuite.at: New file.
	* tests/envdump.c: Add more features.
	* tests/waitfile.c: New file.

	Add tests directory.

	* Makefile.am (SUBDIRS): Add tests
	* configure.ac: Build tests/Makefile.
	* tests/.gitignore: New file
	* tests/Makefile.am: New file.
	* tests/envdump.c: New file.

	Minor fixes

	* src/cmdline.opt (help_hook): Change wording.
	* src/config.c (config_help): Fix a typo.
	* src/dircond.c (signal_setup): Include SIGCHLD
	(main): Reset grecs_log_to_stderr.
	* src/progman.c (run_handler): SIGCHLD is handled
	by signal_setup.

	Improve command line handling.

	* configure.ac (GRECS_SETUP): Request getopt.
	* src/.gitignore: Add cmdline.h
	* src/cmdline.opt: New file.
	* src/Makefile.am: Add new rules.
	* src/config.c: New statement "user".
	* src/dircond.c: Change command line handling.

	Control execution environment and handler arguments.

	* src/environ.c: New file.
	* src/Makefile.am: Add environ.c
	* src/config.c: Rename "event" compound statement to "watcher".
	New statement "environ".
	* src/dircond.h (handler) <env>: New member.
	(environ_setup): New proto.
	* src/progman.c (event_to_env): Remove function.
	(runcmd): New function.
	(run_handler): Call runcmd to prepare execution environment and
	launch the handler.

	Minor improvements

	* /src/dircond.c (vdiag): Implement print-priority.
	(main): Print version number along with the startup
	and shutdown messages.

	Upgrade grecs

	Add bootstrap

	Rewrite configuration support using grecs.

	* grecs: Incorporate grecs as a submodule
	* .gitmodules: New file.
	* src/config.c: Rewrite.
	* src/dircond.c: Use grecs.
	* src/dircond.h (opt_facility): Remove
	(syslog_include_prio): New global.
	(pathent) <next>: Remove.
	* pathdefn.c: Remove.

	Switch to deep structure.

	Change version number. Update THANKS file.  Improve -h output.

	Make sure directory and filename parts are meaningful when calling the handler.

	* dircond.h (dirwatcher) <split_p>: New member.
	<file_mode>: Change type to mode_t.
	(run_handler): Change signature.
	(split_pathname,unsplit_pathname): New protos.
	* ev_inotify.c (process_event): Use split_pathname
	to obtain file and directory parts if the watched
	object is not a directory.
	* ev_kqueue.c (filename): Remove function.
	(check_created): Change call to run_handler.
	(process_event): Use split_pathname
	to obtain file and directory parts.
	* progman.c (run_handler): Change signature and
	calling convention.
	* watcher.c (watch_subdirs): Fix diagnostics message.
	(split_pathname,unsplit_pathname): New functions.

	One more fix.

	* dircond.c (trans_strtotok): 2nd arg is const
	* dircond.h: Ditto.

	Add missing include.

	Keep separate process entries for redirectors.

	* dircond.h: Remove unneeded prototypes.
	* progman.c (process) <type,v>: New members.
	(register_process): Take process type as the first argument.
	(process_cleanup): Update.
	(open_redirector): Change type of the last argument.
	(run_handler): Reflect changes in open_redirector.

	Move process management functions into a separate module.

	Minor fixes.

	Introduce system-independent event codes.

	* config.c (parse_event, parse_onevent): Use event_mask structure.
	* dircond.c (trans_strtotok, trans_toktostr)
	(trans_toknext,trans_tokfirst)
	(ev_log): New functions
	(event_to_env): New static.
	(run_handler): Take a pointer to event_mask.
	Use event_to_env to construct the environment.
	(man): Initialize system-independent events.
	* dircond.h (SIE_CREATE, SIE_WRITE)
	(SIE_ATTRIB, SIE_DELETE): System-independent event codes.
	(event_mask): New typedef.
	(event): Remove structure.
	(transtab): New structure.
	(handler) <ev_mask>: Change type to event_mask.
	(evsys_filemask): New proto.
	(evsys_add_watch,run_handler): Change signature.
	(defevt, getevt): Likewise,
	(evtnullp, event_mask_init): New protos.
	(sie_xlat, sie_trans, evsys_transtab): New externs.
	(trans_strtotok, trans_toktostr)
	(trans_tokfirst, trans_toknext): New protos.
	* ev_inotify.c (evsys_transtab): New global.
	(sie_xlat): New global.
	(ev_log): Remove.
	(evsys_filemask): Remove variable, add function.
	(evsys_add_watch): Change signature.
	* ev_kqueue.c (events): Remove.
	(evsys_transtab): New global.
	(evsys_name_to_code, evsys_code_to_name): Remove.
	(evsys_filemask): Remove variable, add function.
	(ev_log): Remove.
	(sie_xlat): New global.
	(evsys_add_watch): Change signature.
	Add NOTE_WRITE to directory flags if SIE_CREATE is requested.
	(check_created): Deliver the SIE_CREATE event.
	(process_event): Update.
	* event.c (symevt) <mask>: Change type to event_mask.
	(defevt,getevt): Rewrite taking event_mask as additional
	argument.
	(evtnullp): New function
	(sie_trans): New global.
	(event_mask_init): New function.
	* watcher.c (dirwatcher_init): Initialize both system-dependent
	and system-independent event masks.
	(watch_subdirs): Call evsys_filemask to decide which files to
	watch.

	Use fd_set capable of keeping sysconf(_SC_OPEN_MAX) descriptors.

	* dircond.c (bigfd_set): New type
	(BIGFD_SET_COUNT, BIGFD_SET_ALLOC)
	(BIGFD_SET, BIGFD_ISSET): New macros.
	(close_fds): Use bigfd_set. All callers updated.

	Bugfix

	* dircond.h (dirwatcher_lookup): New proto.
	* watcher.c (dirwatcher_lookup): Remove static qualifier.

	kqueue: handle file creates and deletes.

	* dircond.h (dirwatcher) [USE_IFACE == IFACE_KQUEUE] <file_mode>
	<file_ctime>: New members.
	(remove_watcher): Remove prototype.
	(dirwatcher_destroy,watch_pathname): New protos.
	* ev_inotify.c (remove_watcher): New function (from watcher.c)
	* ev_kqueue.c (evsys_add_watch): Use EV_CLEAR instead of EV_ONESHOT.
	Initialize file_mode and file_ctime.
	(evsys_rm_watch): Fix conditional.
	(check_created): New function.
	(process_event): Handle file additions and deletions.
	* watcher.c (watch_subdirs): Use watch_pathname.
	(watch_pathname): New function.

	Restore default timeout.

	The default timeout setting was inadvertently lost in 02f27691.

	* config.c (opt_timeout): Initialize.
	* dircond.h (DEFAILT_TIMEOUT): New constant.

	Bugfix.

	* ev_kqueue.c (process_event): Strip directory prefix off the
	file name.

	Move commonly used headers to dircond.h

	Change main loop.

	* dircond.c: Change main loop.
	* dircond.h (evsys_loop): Remove.
	(evsys_select): New proto.
	* ev_inotify.c: Likewise.
	* ev_kqueue.c: Likewise.

	Initial implementation of kqueue support.

	* ev_inotify.c: New file.
	* ev_kqueue.c: New file.
	* configure.ac: Set up automake conditionals and defines
	depending on the selected interface. Bail out if no suitable
	interface is found.
	* Makefile.am: Add the right ev_*.c source to dircond_SOURCES.
	* dircond.c (run_handler): Remove static qualifier.
	(process_event): Remove.
	(main): Use evsys_* calls for interface-dependent operations.
	* dircond.h (event): New struct.
	(ifd): Remove extern.
	(signo): New extern.
	(ev_name_to_code): Rename to evsys_name_to_code.
	(ev_code_to_name): Rename to evsys_code_to_name.
	(ev_log): Remove.
	(evsys_init,evsys_add_watch)
	(evsys_rm_watch,evsys_loop): New protos.
	(evsys_filemask): New extern.
	* event.c: Remove interface-dependent stuff.
	* watcher.c (dirwatcher_install): Initialize wd to -1.
	(watch_subdirs): Use evsys_filemask to decide whether to scan the
	directory.
	All functions: Use evsys_* calls for interface-dependent operations.

	Autoconfiscate

	* .gitignore: Update
	* AUTHORS: New file.
	* Makefile.am: New file.
	* THANKS: New file.
	* configure.ac: New file.
	* Makefile: Remove.
	* NEWS: Update.
	* dircond.c: Include config.h
	* event.c: Likewise.
	* hashtab.c: Likewise.
	* pathdefn.c: Likewise.
	* watcher.c: Likewise.

	Update NEWS

2013-05-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix a typo

2013-05-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix

	* watcher.c (watch_subdirs): Fix erroneous conversion specifier
	in the diagnostics message.

2013-05-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* config.c (parse_option): Fix the sense of the nowait option.

	Fix help output.

2013-05-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Restore default timeout.

	The default timeout setting was inadvertently lost in 02f27691.

	* config.c (opt_timeout): Initialize.
	* dircond.h (DEFAILT_TIMEOUT): New constant.

	Bugfix.

	* pathdefn.c (pathdefn_get): Fix return value.

2013-05-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Lint mode

	* dircond.c (main): Use the -L option to introduce syslog tag
	and the -t option to request "lint" behavior.
	* dircond.1: Update.

2013-03-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix

	* dircond.c (setuser): Set up supplementary groups of the user.

2013-03-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	New feature: run handler as a specified user.

	* config.c (parse_onevent): Change "call" to "run".  Retain
	the latter for compatibility.
	Hanlde optional "as USER" clause.
	Bugfix: initialize hp->next.
	* dircond.1: Document changes.
	* dircond.c (run_handler): Switch to the requested user
	privileges before running the handler.
	* dircond.h (handler) <uid,gidv,gidc>: New members.

2013-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix syslog vs. stderr inconsistency.

	* config.c (opt_facility): new global.
	(parse_syslog): Set opt_facility, unless
	it is already set (in the command line).
	* dircond.c (main) <opt_facility>: Remove (now global).
	* dircond.h (opt_facility): New extern.

	* Makefile (clean): add dircond

2013-03-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	More fixes.

	* dircond.c (print_status): Take sigset_t* as the
	second argument.  Mask out diagnostic messages
	according to it.
	(process_cleanup): Mask out SIGTERM and SIGKILL
	as needed.
	(run_handler): Swap redirectors syslog priorities:
	stderr goes to LOG_ERR, and stdout to LOG_INFO.

	Bugfixes.

	* config.c (read_facility): Fix return value.
	* dircond.c: Fix help output.
	* dircond.1: Fix incorrect example.

2013-02-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update docs.

	New option -V

	* Makefile (CPPFLAGS): Define VERSION
	* dircond.c: New option -V (print version).
	* dircond.1: Document new option.

	Bugfixes.

	* Makefile (DISTFILES): Bugfix.
	* config.c (parse_event): Bugfix.
	* NEWS: Update (version 3.0, preliminary)

2013-01-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* config.c (nextln): Fix out of range read.
	* dircond.1: Update.
	* event.c (ev_code_to_name): Find first matching event.
	Do not rely on exact match, because the even mask may
	have several bits set.

	Improve error handling.

	* config.c (parse_path): Bail out if incorrect option
	is given.
	* dircond.h (hashtab_count): New proto.
	* hashtab.c (hashtab_count): New function.
	* watcher.c (setup_watchers): Bail out if no handlers configured
	or if unable to install any.

	Improve configuration syntax, document the changes.

	* config.c (path statement): New keyword "recursive".
	* dircond.c (process_event): Provide a detailed
	event logging.
	* event.c (ev_log): New function.

	* dircond.1: Document all changes.

	* dircond.h: Add file.

	Major revamp

	All configuration moved to configuration file (default: /etc/dircond.conf).
	Only a few command line options have been retained.

	Watcher structures are kept in hash tables, which allows for faster
	lookups, especially if there are many watchers.

	* Makefile: Add new source.
	* config.c: New file.
	* dircond.c (conffile): New global.
	(facility): Default to stderr. Will be changed by main if
	going daemon.
	(handler_timeout, autowatch): Remove.
	Move datatype definitions and macros to dircond.h
	(ev_name_to_code, ev_code_to_name): Move to event.c
	(erealloc, estrdup): New functions.
	(proc_unlink, proc_pop, proc_push): Define explicitly, now
	that dlist.c is gone.
	(read_facility): Move to config.c, changing signature.
	(set_handler): Remove.
	(dirwatcher_free, dirwatcher_create)
	(dirwatcher_destroy, dirwatcher_find_wd)
	(dirwatcher_find_name): Remove. See watcher.c
	(remove_watcher, subwatcher_create)
	(check_new_watcher, watch_subdirs): Move to watcher.c
	(get_facility): New function.
	(process_event): New function.
	(main): Parse configuration file. Use command line options
	to override its settings.
	* dlist.c: Remove.
	* event.c: New file.
	* hashtab.c: New file.
	* pathdefn.c: New file.
	* watcher.c: New file.

2013-01-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revamp the event and handler system.

	Events are directly mapped to those of inotify. Handlers are kept in a
	doubly-linked list; a special field keeps the mask of supported events.
	The accepted '-p' syntax is changed accordingly. Docs are not yet
	updated.

	* dircond.c (event): New struct.
	(evtab): New global.
	(handler) <prev,next,ev_mask>: New members.
	(dirwatcher) <handler_list>: New member (instead of the
	handler array).
	(handler_list,handler_mask): New globals.
	(ev_name_to_code,ev_code_to_name): New functions.
	(set_handler): Change accepted syntax. The new syntax is

	event[,event...][:flag[,flag...]]:pathname

	(dirwatcher_create): Use handler_mask instead of the hardcoded
	mask.
	(dirwatcher_destroy): Free the handler list, if this is a top-level
	watcher.
	(subwatcher_create): Update to use new variables.
	(main): Likewise.

2013-01-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve error reporting.

	* dircond.c (run_handler,set_handler): Check if the handler can
	be executed.

	Update documentation

	Watch existing subdirectories, as requested by the autowatch option.

	* dircond.c (subwatcher_create): New function.
	(check_new_watcher): Use subwatcher_create.
	(watch_subdirs): New function.
	(main): Recursively add directories after watchpoint if autowatch
	requests so.

	Make autowatch feature watchpoint-specific.

	Each particular watchpount can have its own setting of autowatch, as
	specified by the -a option.

	* dircond.c (dirwatcher) <autowatch>: New member.
	(dirwatcher_create): Fill allocated structure with zeroes.
	(dirlevel): Remove function.
	(check_new_watcher): Use dirwatcher->autowatch to determine
	whether to watch the new directory.  Inherit autowatch setting.
	(main): Set dirwatcher->autowatch.

	New flag "timeout="

	* dircond.c (set_handler): The timeout=N flag sets timeout
	for that particular handler (equivalent to -T option used
	before -p).
	* dircond.1: Document the new flag.

2013-01-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add documentation files. Raise version to 2.0

	* .gitignore: Update.
	* Makefile: Add NEWS and ChangeLog, generate the latter.
	* NEWS: New file.
	* git2chg.awk: New file.

	Fix help output.

	Support multiple per-directory handlers.

	* dircond.c (handler) <timeout>: New member.
	(dirwatcher) <handler>: New member.
	(process) <master>: Remove.
	<timeout>: New member.
	Fix comments.
	(set_handler): Change supported syntax. The program name
	is separated from the event spec and optional flags by
	a semicolon. It can be empty, allowing to cancel a prior
	definition of the same handler.
	(register_process): Take timeout as the third argument.
	(process_timeouts): Use per-process timeout.
	(open_redirector): Fix the use of facility.
	(run_handler): Change signature.
	(main): Change option handling, allowing to intermix
	handler and watchpoint definitions.
	* README: Update.
	* dircond.1: Update.
	* dlist.c: Add copyright header.

	Fix a "fencepost" error in close_fds.

	* dircond.c (close_fds): Start iterating from max_fd-1.

2012-12-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* COPYING: New file.
	* Makefile: Distribute COPYING.
	* dircond.c (main): tag is now const char *.

	Switch to user privileges only if -u option is explicitly given.

	Improve documentation.

2012-12-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add a manpage.

	* Makefile: Add a manpage.
	* dircond.c (run_handler): Pass event code and
	event symbolic name to the handler.

	Add support for IN_MOVED_FROM and IN_MOVED_TO.

	Initial commit

Local Variables:
mode: change-log
version-control: never
buffer-read-only: t
End: