xref: /freebsd/lib/libc/stdlib/remque.c (revision edf8578117e8844e02c0121147f45e4609b30680)
1 /*
2  * Initial implementation:
3  * Copyright (c) 2002 Robert Drehmel
4  * All rights reserved.
5  *
6  * As long as the above copyright statement and this notice remain
7  * unchanged, you can do what ever you want with this file.
8  */
9 #include <sys/cdefs.h>
10 #define	_SEARCH_PRIVATE
11 #include <search.h>
12 #include <stdlib.h>	/* for NULL */
13 
14 void
15 remque(void *element)
16 {
17 	struct que_elem *prev, *next, *elem;
18 
19 	elem = (struct que_elem *)element;
20 
21 	prev = elem->prev;
22 	next = elem->next;
23 
24 	if (prev != NULL)
25 		prev->next = next;
26 	if (next != NULL)
27 		next->prev = prev;
28 }
29