Sync libc/stdlib with FreeBSD (ignoring jemalloc, pts, and gdtoa):
[dragonfly.git] / lib / libc / stdlib / remque.c
blob6da9e397d99b5a4e2efa2cef7a962513d4de8e88
1 /*
2 * Initial implementation:
3 * Copyright (c) 2002 Robert Drehmel
4 * All rights reserved.
6 * As long as the above copyright statement and this notice remain
7 * unchanged, you can do what ever you want with this file.
9 * $FreeBSD: src/lib/libc/stdlib/remque.c,v 1.3 2003/01/04 07:34:41 tjr Exp $
12 #define _SEARCH_PRIVATE
13 #include <search.h>
14 #include <stdlib.h> /* for NULL */
16 void
17 remque(void *element)
19 struct que_elem *prev, *next, *elem;
21 elem = (struct que_elem *)element;
23 prev = elem->prev;
24 next = elem->next;
26 if (prev != NULL)
27 prev->next = next;
28 if (next != NULL)
29 next->prev = prev;