summaryrefslogtreecommitdiff
path: root/common/loop.c
AgeCommit message (Collapse)AuthorLines
2024-02-16Define _POSIX_C_SOURCE globallyFurkan Sahin-1/+0
See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
2020-06-15common/loop: check return of reallocFurkan Sahin-3/+9
2019-01-20Replace wlr_log with sway_logFurkan Sahin-3/+3
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
2018-12-09list.c: rename free_flat_list to list_free_items_and_destroyFurkan Sahin-2/+2
2018-12-08list.c: Remove list_foreachFurkan Sahin-4/+2
Most occurrences have been replaced by `free_flat_list` which has been moved from stringop.c to list.c. The rest have been replaced by for loops.
2018-10-17Increase _POSIX_C_SOURCE to 200112LFurkan Sahin-1/+1
CLOCK_MONOTONIC appeared in IEEE Std. 1003.1-200x, it was not part of POSIX.1b (the 1993 version), and FreeBSD treats it accordingly.
2018-10-15common/loop.c: add _POSIX_C_SOURCE for clock_gettime and CLOCK_MONOTONICFurkan Sahin-0/+1
2018-10-15Event loop: Fix memmove and remove extraneous declarationFurkan Sahin-1/+1
2018-10-14Event loop: Free fds and fix race conditionFurkan Sahin-0/+4
2018-10-14Remove timerfd from loop implementationFurkan Sahin-43/+100
timerfd doesn't work on the BSDs, so this replaces it with a timespec for the expiry and uses a poll timeout to check the timers when needed.
2018-10-13swaylock: Remove indicator after 3 secondsFurkan Sahin-3/+16
2018-10-13Move swaybar's event loop to common directory and refactorFurkan Sahin-0/+105
* The loop functions are now prefixed with `loop_`. * It is now easy to add timers to the loop. * Timers are implemented using pollfd and timerfd, rather than manually checking them when any other event happens to arrive.