]>
git.saurik.com Git - apple/libc.git/blob - stdlib/FreeBSD/insque.c
2 * Initial implementation:
3 * Copyright (c) 2002 Robert Drehmel
6 * As long as the above copyright statement and this notice remain
7 * unchanged, you can do what ever you want with this file.
10 __FBSDID("$FreeBSD: src/lib/libc/stdlib/insque.c,v 1.3 2003/01/04 07:34:41 tjr Exp $");
12 #define _SEARCH_PRIVATE
17 #include <stdlib.h> /* for NULL */
21 insque(void *element
, void *pred
)
23 struct que_elem
*prev
, *next
, *elem
;
25 elem
= (struct que_elem
*)element
;
26 prev
= (struct que_elem
*)pred
;
29 elem
->prev
= elem
->next
= NULL
;
36 if (next
->prev
!= prev
) {
37 fprintf(stderr
, "insque: Inconsistency detected:"
38 " next(%p)->prev(%p) != prev(%p)\n",
39 next
, next
->prev
, prev
);