diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-08-14 09:07:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 09:07:59 -0400 |
commit | b4887ba154ab0d659c560a21194c8ca43b953632 (patch) | |
tree | d1d693231ab91f1ef2fe98a437cc260daf755142 /common/list.c | |
parent | Merge pull request #2454 from minus7/workspace-names (diff) | |
parent | Don't commit multiple transactions at the same time (diff) | |
download | sway-b4887ba154ab0d659c560a21194c8ca43b953632.tar.gz sway-b4887ba154ab0d659c560a21194c8ca43b953632.tar.zst sway-b4887ba154ab0d659c560a21194c8ca43b953632.zip |
Merge pull request #2445 from RyanDwyer/resize-tiling-via-cursor
Implement resizing tiled containers via cursor
Diffstat (limited to 'common/list.c')
-rw-r--r-- | common/list.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/list.c b/common/list.c index 66d52f70..a3a22d8f 100644 --- a/common/list.c +++ b/common/list.c | |||
@@ -77,6 +77,15 @@ int list_seq_find(list_t *list, int compare(const void *item, const void *data), | |||
77 | return -1; | 77 | return -1; |
78 | } | 78 | } |
79 | 79 | ||
80 | int list_find(list_t *list, void *item) { | ||
81 | for (int i = 0; i < list->length; i++) { | ||
82 | if (list->items[i] == item) { | ||
83 | return i; | ||
84 | } | ||
85 | } | ||
86 | return -1; | ||
87 | } | ||
88 | |||
80 | void list_swap(list_t *list, int src, int dest) { | 89 | void list_swap(list_t *list, int src, int dest) { |
81 | void *tmp = list->items[src]; | 90 | void *tmp = list->items[src]; |
82 | list->items[src] = list->items[dest]; | 91 | list->items[src] = list->items[dest]; |