From 32e6a41f33e5576716b351bd473a27939fe94fa1 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Mon, 15 Dec 2008 15:22:34 +1100 Subject: Initial support for multiple UIs Move the device discovery code from separate udev helpers to a single process to listen on two sockets: one SOCK_DGRAM for incoming udev events, and one SOCK_STREAM for UIs to connect. Initial support for client/server infrastructure, still need to wire-up the udev messages. Signed-off-by: Jeremy Kerr --- lib/list/list.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/list/list.c (limited to 'lib/list/list.c') diff --git a/lib/list/list.c b/lib/list/list.c new file mode 100644 index 0000000..d9bc532 --- /dev/null +++ b/lib/list/list.c @@ -0,0 +1,24 @@ + +#include "list/list.h" + +void list_init(struct list *list) +{ + list->head.next = &list->head; + list->head.prev = &list->head; +} + +void list_add(struct list *list, struct list_item *new) +{ + new->next = list->head.next; + new->prev = &list->head; + + list->head.next->prev = new; + list->head.next = new; +} + +void list_remove(struct list_item *item) +{ + item->next->prev = item->prev; + item->prev->next = item->next; +} + -- cgit v1.2.1