aboutsummaryrefslogtreecommitdiff
path: root/autoreload_inotify.c
Commit message (Collapse)AuthorAgeFilesLines
* mark functions and vars as static (#146)N-R-K2021-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | the goal here to mark functions and variables not used outside the translation unit as static. main reason for this is cleanliness. however as a side-effect this can help compilers optimize better as it now has guarantee that a certain function won't be called outside of that translation unit. one other side-effect of this is that accessing these vars/function from config.h is now different. if one wants to access a static var/func from different translation unit in config.h, he would have to create a wrapper function under the right ifdef. for static functions one would also need to forward declare it. here's a dummy example of accessing the function `run_key_handler` from config.h under _MAPPINGS_CONFIG ``` static void run_key_handler(const char *, unsigned); bool send_with_ctrl(arg_t key) { run_key_handler(XKeysymToString(key), ControlMask); return false; } ```
* code-style: fix consistency issues all over the codebase (#94)Berke Kocaoğlu2021-10-111-7/+6
| | | | | | | | | | | | | | | * 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>
* Rename, Update Docs and Prepare for Release (#9)Berke Kocaoğlu2021-09-161-5/+5
| | | | | | | 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>
* Ignore outdated inotify eventsBert Münnich2018-02-181-7/+7
|
* One header file for type definitions and function declarationsBert Münnich2017-10-161-3/+2
|
* Update copyright notice in autoreload_inotify.cBert Münnich2017-05-171-1/+1
|
* Detect all file overwrites in autoreload_inotifyBert Münnich2017-05-171-66/+44
| | | | | | | | | | | | 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.
* Compiler independent buffer alignmentBert Münnich2017-05-171-3/+7
|
* Read all available inotify eventsBert Münnich2017-05-171-27/+32
| | | | Loop reading from inotify fd in arl_handle(); requires non-blocking inotify fd.
* Simplify inotify cleanupBert Münnich2017-05-171-2/+2
|
* Revised error reporting in autoreload_inotifyBert Münnich2017-05-171-20/+11
| | | | | No repeated error messages after failed initialization. No error messages on failed inotify_rm_watch().
* Fix code-style in autoreload_inotify.cBert Münnich2017-05-171-38/+23
|
* Revised autoreload interfaceBert Münnich2017-05-171-57/+53
| | | | | | | | | | | | 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.
* Add autoreload support by inotify (and dummy backend nop)Max Voit2017-05-171-0/+154