diff options
| author | Robert Drehmel <robert@FreeBSD.org> | 2002-10-16 14:00:46 +0000 | 
|---|---|---|
| committer | Robert Drehmel <robert@FreeBSD.org> | 2002-10-16 14:00:46 +0000 | 
| commit | e768c1be41aefcb7cf8fb19b12cf21d523dc4cdf (patch) | |
| tree | f842a8fc345135dd3f0a7b4514d049f10569985e /lib/libc/stdlib/remque.c | |
| parent | dc51023cb319a421c1d1f7bfb06f90e5e0fb500a (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib/remque.c')
| -rw-r--r-- | lib/libc/stdlib/remque.c | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/lib/libc/stdlib/remque.c b/lib/libc/stdlib/remque.c new file mode 100644 index 000000000000..234118876891 --- /dev/null +++ b/lib/libc/stdlib/remque.c @@ -0,0 +1,31 @@ +/* + * Initial implementation: + * Copyright (c) 2002 Robert Drehmel + * All rights reserved. + * + * As long as the above copyright statement and this notice remain + * unchanged, you can do what ever you want with this file.  + * + * $FreeBSD$ + */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#define	_SEARCH_PRIVATE +#include <search.h> +#include <stdlib.h>	/* for NULL */ + +void remque(void *element) +{ +	struct que_elem *prev, *next, *elem; + +	elem = (struct que_elem *)element; + +	prev = elem->prev; +	next = elem->next; + +	if (prev != NULL) +		prev->next = next; +	if (next != NULL) +		next->prev = prev; +} | 
