aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-14 09:07:59 -0400
committerGitHub <noreply@github.com>2018-08-14 09:07:59 -0400
commitb4887ba154ab0d659c560a21194c8ca43b953632 (patch)
treed1d693231ab91f1ef2fe98a437cc260daf755142 /common
parentd0fb2d9a53662c8629f1a0f0a57e83e6f36285c4 (diff)
parent4b8e3a885be74c588291c51f798de80bd81a92db (diff)
Merge pull request #2445 from RyanDwyer/resize-tiling-via-cursor
Implement resizing tiled containers via cursor
Diffstat (limited to 'common')
-rw-r--r--common/list.c9
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),
return -1;
}
+int list_find(list_t *list, void *item) {
+ for (int i = 0; i < list->length; i++) {
+ if (list->items[i] == item) {
+ return i;
+ }
+ }
+ return -1;
+}
+
void list_swap(list_t *list, int src, int dest) {
void *tmp = list->items[src];
list->items[src] = list->items[dest];