Commit Graph

13 Commits (12efa0e3b429675047cb2900d49e1f38afeb650b)

Author SHA1 Message Date
Berke Kocaoğlu 1449bfc5e9
code-style: fix consistency issues all over the codebase (#94)
* remove duplicate comment
* remove empty tabs and blank lines
* move macros and globals ontop
* comment to seprate function implementation
* fix alignment
* switch to *argv[] similar to other suckless code
* kill all empty last lines
* append comment to endif
* reuse existing ARRLEN macro
* comment fall through
* use while (true) everywhere

Co-authored-by: NRK <nrk@disroot.org>
3 years ago
Berke Kocaoğlu 7cce7ea857 Rename, Update Docs and Prepare for Release (#9)
Co-authored-by: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com>
Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
Co-authored-by: NRK <nrk@disroot.org>
Co-authored-by: Arthur Williams <taaparthur@gmail.com>
Co-authored-by: eylles <ed.ylles1997@gmail.com>
3 years ago
Bert Münnich 48e0b70ad3 Ignore outdated inotify events 6 years ago
Bert Münnich 148026007c One header file for type definitions and function declarations 7 years ago
Bert Münnich c027122c5f Update copyright notice in autoreload_inotify.c 7 years ago
Bert Münnich a20173a42d Detect all file overwrites in autoreload_inotify
mv(1) inside the same filesystem was not detected.

Supporting this case made it necessary to always watch the directory. Turns out
the logic and state keeping between arl_setup() and arl_handle() is easier,
when using different watch descriptors for the file and the directory and not
using a oneshot descriptor for the file.

Requiring an absolute canonical path for arl_setup() simplifies dir and base
name splitting. No need for dirname(3) and basename(3) anymore.
7 years ago
Bert Münnich de3d7827ce Compiler independent buffer alignment 7 years ago
Bert Münnich 0e1a85d224 Read all available inotify events
Loop reading from inotify fd in arl_handle(); requires non-blocking inotify fd.
7 years ago
Bert Münnich 6695cd4c34 Simplify inotify cleanup 7 years ago
Bert Münnich 8bce80fdae Revised error reporting in autoreload_inotify
No repeated error messages after failed initialization. No error messages on
failed inotify_rm_watch().
7 years ago
Bert Münnich 9ac8fc62df Fix code-style in autoreload_inotify.c 7 years ago
Bert Münnich 3724d3fc17 Revised autoreload interface
Make the header only contain the public interface and nothing from the
implementation. All functions get a handle to their self object, like the img_
and tns_ and win_ functions. All necessary data (file path) is also passed as
an argument, so that no extern redeclarations are needed.

Make arl_setup_dir() private, it's not called outside the module.

Make arl_handle() return true if the file has changed, so that the reloading of
the file can be done by the caller.
7 years ago
Max Voit edb117e3bd Add autoreload support by inotify (and dummy backend nop) 7 years ago