aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFiles
2016-08-25Update the documentationsentinelSergey Poznyakoff3
2016-08-25Get rid of hashtab.c, use symtab from grecs instead.Sergey Poznyakoff8
* 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.
2016-08-25Rename a test caseSergey Poznyakoff3
* tests/Makefile.am: Update. * tests/testsuite.at: Update. * tests/conv.at: Rename to tests/file.at
2016-08-25Fix new functionality on BSD hosts. Some minor fixes.Sergey Poznyakoff9
* 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.
2016-08-23Add new tests + minor fixes.Sergey Poznyakoff7
* 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.
2016-08-23Further modify struct handler.Sergey Poznyakoff8
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.
2016-08-22Rename: struct dirwatcher -> struct watchpointSergey Poznyakoff8
2016-08-22Implement sentinel handlers.Sergey Poznyakoff9
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.
2016-08-22BugfixSergey Poznyakoff1
* src/hashtab.c (hashent_list_append): Fix allocated memory size.
2016-08-20Initial preparation for having distinct handler types.Sergey Poznyakoff6
* 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-13Clean-up handler initialization routines.Sergey Poznyakoff3
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.
2016-08-13Limit memory usage.Sergey Poznyakoff6
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.
2016-08-13Fix commentsSergey Poznyakoff1
2016-08-12Version 5.1.90Sergey Poznyakoff5
* NEWS: Update. * configure.ac: Update. * src/watcher.c (setwatcher): Fix conditional. * src/direvent.h (dirwatcher_pattern_match): Add missing prototype.
2016-08-12Don't keep watchpoint descriptor tableSergey Poznyakoff5
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-11BugfixesSergey Poznyakoff6
* 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-06Version 5.1release-5.1Sergey Poznyakoff2
2016-07-04Remove unused variablesSergey Poznyakoff1
2016-07-04Use latest commit of grecsSergey Poznyakoff2
2016-07-04Update copyright yearsSergey Poznyakoff47
2016-06-20Update grecsSergey Poznyakoff1
2016-06-20Make sure descriptor 0 is allocated before calling detach.Sergey Poznyakoff1
* grecs: Upgrade to 9161098.
2016-06-20BugfixSergey Poznyakoff1
* configure.ac (INCLUDE_PATH_ARGS): Quote definition for shell
2016-06-20Implement search path for #include and #include_once.Sergey Poznyakoff12
* 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-18New option to invoke handlers via /bin/shSergey Poznyakoff10
* 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.
2016-06-18Globbing patterns in #include and #include_onceSergey Poznyakoff6
* 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-23Fix doc generation.Sergey Poznyakoff2
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-16Version 5.0.90Sergey Poznyakoff2
2015-03-01Switch to Texinfo 5.0Sergey Poznyakoff4
* doc/Config: Rewrite. * doc/Makefile.am: Use Makeinfo 5 instead of texi2htm * doc/gendocs_template: Ps is not built * imprimatur: Upgrade.
2014-09-18Minor documentation fixes.Sergey Poznyakoff3
* doc/direvent.8: Escape dashes in examples. * doc/direvent.conf.5: Likewise. * doc/direvent.texi: Reword copyright statement (part about covers).
2014-09-06Version 5.0release-5.0Sergey Poznyakoff2
2014-09-06Add new testSergey Poznyakoff5
* tests/samepath.at: New file. * tests/Makefile.am: Add new testcase. * tests/testsuite.at: Likewise. * NEWS: Update * README: Update
2014-09-01Version 4.1.91Sergey Poznyakoff2
2014-09-01Improve I18NSergey Poznyakoff4
* 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-01Improve and document self-test modeSergey Poznyakoff5
* 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-01bootstrap: add option to get update po files and exitSergey Poznyakoff1
2014-08-31Accept multpile watchers for the same pathSergey Poznyakoff2
* 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-27Minor changesSergey Poznyakoff1
* src/direvent.c (get_user_groups): Fix typo in a diagnostic message.
2014-08-27bootstrap: download po filesSergey Poznyakoff1
2014-08-25Update NEWSSergey Poznyakoff1
2014-08-25Upgrade grecsSergey Poznyakoff1
2014-08-25I18NSergey Poznyakoff20
* .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-22Update docsSergey Poznyakoff2
2014-08-21Minor fix in docsSergey Poznyakoff2
2014-08-21Direvent is dubbed GNU programSergey Poznyakoff4
* 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-17Rewrite testsuite.Sergey Poznyakoff27
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)
2014-08-17Rename project to direvent.Sergey Poznyakoff55
2014-08-10Version 4.1.90dircond-lastSergey Poznyakoff8
* 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-29Introduce pattern negation.Sergey Poznyakoff11
* 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-27Remove trailing tabs in doc/dircond.8Sergey Poznyakoff1

Return to:

Send suggestions and report system problems to the System administrator.