xref: /freebsd/lib/libc/stdlib/remque.c (revision 4c9a0adad18263ec8725d9bfc5f560c6ad1da8bd)
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 #define	_SEARCH_PRIVATE
10 #include <search.h>
11 #include <stdlib.h>	/* for NULL */
12 
13 void
14 remque(void *element)
15 {
16 	struct que_elem *prev, *next, *elem;
17 
18 	elem = (struct que_elem *)element;
19 
20 	prev = elem->prev;
21 	next = elem->next;
22 
23 	if (prev != NULL)
24 		prev->next = next;
25 	if (next != NULL)
26 		next->prev = prev;
27 }
28