AgeCommit message (Collapse)AuthorFiles
2019-07-13Version 5.2HEADrelease-5.2masterSergey Poznyakoff2
2019-07-10Switch to grecs b06fb7d3Sergey Poznyakoff3
2016-08-25Update the documentationSergey Poznyakoff3
2016-08-25Get rid of hashtab.c, use symtab from grecs instead.Sergey Poznyakoff8
* grecs: Pull new version. * src/hashtab.c: Remove. * po/ Remove src/hashtab.c * src/ (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/ Update. * tests/ Update. * tests/ Rename to tests/
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/ Clear expected stderr. * tests/ Fix race condition.
2016-08-25Add 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/ New test. * tests/ New test. * tests/ Add new tests. * tests/ Likewise.
2016-08-25Further 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-25Rename: struct dirwatcher -> struct watchpointSergey Poznyakoff8
2016-08-25Implement 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/ (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-25BugfixSergey Poznyakoff1
* src/hashtab.c (hashent_list_append): Fix allocated memory size.
2016-08-25Initial 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-20Fix environment modification codeSergey Poznyakoff1
Port fixes from rush
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. * 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/ (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
* (INCLUDE_PATH_ARGS): Quote definition for shell
2016-06-20Implement search path for #include and #include_once.Sergey Poznyakoff12
* src/ (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. * 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/ New test case. * tests/ Add new test. * tests/ 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/ 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/ (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/ 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/ New file. * tests/ Add new testcase. * tests/ Likewise. * NEWS: Update * README: Update
2014-09-01Version 4.1.91Sergey Poznyakoff2
2014-09-01Improve I18NSergey Poznyakoff4
* po/ Add grecs sources. * src/ (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-26bootstrap: 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. * (SUBDIRS): Add po * acinclude.m4: New file. * Use gettext * doc/direvent.texi: Update * po/.gitignore: New file * po/ New file. * po/Makevars: New file. * src/ (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/ Remove superfluous quoting.
2014-08-22Update docsSergey Poznyakoff2
2014-08-21Minor fix in docsSergey Poznyakoff2
2014-08-21Direvent is dubbed GNU programSergey Poznyakoff4
* 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/ 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/ (AT_DIREVENT_TEST): New macro. * tests/ Rewrite using AT_DIREVENT_TEST. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * grecs (untracked content)
2014-08-17Rename project to direvent.Sergey Poznyakoff55

Return to:

Send suggestions and report system problems to the System administrator.