xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 8d5672127b4354c447ccbb65358deeb467d8ced2

Remove utils/selector:selector_remove()
It's not used anymore.
Author: xaizek
Author date (UTC): 2024-03-11 13:48
Committer name: xaizek
Committer date (UTC): 2024-03-11 17:30
Parent(s): 6e86c8f497f86ca1afaa7ae9c91bf29e2df09d04
Signing key: 99DC5E4DB05F6BE2
Tree: 0d8cfe280607900ae2e520ddec37e6ca039dd745
File Lines added Lines deleted
src/utils/selector.h 0 3
src/utils/selector_nix.c 0 11
src/utils/selector_win.c 0 14
File src/utils/selector.h changed (mode: 100644) (index abc510ce5..ffd7c3984)
... ... void selector_reset(selector_t *selector);
45 45 /* Adds item to the set of objects to watch. If error occurs, its ignored. */ /* Adds item to the set of objects to watch. If error occurs, its ignored. */
46 46 void selector_add(selector_t *selector, selector_item_t item); void selector_add(selector_t *selector, selector_item_t item);
47 47
48 /* Removes item from the set of objects to watch. */
49 void selector_remove(selector_t *selector, selector_item_t item);
50
51 48 /* Waits for at least one of watched objects to become available for reading /* Waits for at least one of watched objects to become available for reading
52 49 * from during the period of time specified by the delay in milliseconds. * from during the period of time specified by the delay in milliseconds.
53 50 * Returns zero on error or if timeout was reached without any of the objects * Returns zero on error or if timeout was reached without any of the objects
File src/utils/selector_nix.c changed (mode: 100644) (index 959a1e57a..9ee1897ce)
... ... selector_add(selector_t *selector, selector_item_t item)
66 66 } }
67 67 } }
68 68
69 void
70 selector_remove(selector_t *selector, selector_item_t item)
71 {
72 FD_CLR(item, &selector->set);
73 if(item == selector->max_fd)
74 {
75 /* Could do more here. */
76 --selector->max_fd;
77 }
78 }
79
80 69 int int
81 70 selector_wait(selector_t *selector, int delay) selector_wait(selector_t *selector, int delay)
82 71 { {
File src/utils/selector_win.c changed (mode: 100644) (index 20104f118..1fcea2c27)
... ... selector_add(selector_t *selector, selector_item_t item)
90 90 selector->items[selector->size++] = item; selector->items[selector->size++] = item;
91 91 } }
92 92
93 void
94 selector_remove(selector_t *selector, selector_item_t item)
95 {
96 int i;
97 for(i = 0; i < selector->size; ++i)
98 {
99 if(selector->items[i] == item)
100 {
101 selector->items[i] = selector->items[--selector->size];
102 break;
103 }
104 }
105 }
106
107 93 int int
108 94 selector_wait(selector_t *selector, int delay) selector_wait(selector_t *selector, int delay)
109 95 { {
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master