2 This file is in the public domain. */
6 insque, remque -- insert, remove an element from a queue
15 void insque (struct qelem *elem, struct qelem *pred)
17 void remque (struct qelem *elem)
20 Routines to manipulate queues built from doubly linked lists.
21 The insque routine inserts ELEM in the queue immediately after
22 PRED. The remque routine removes ELEM from its containing queue.
37 elem
-> q_forw
= pred
-> q_forw
;
38 pred
-> q_forw
-> q_back
= elem
;
39 elem
-> q_back
= pred
;
40 pred
-> q_forw
= elem
;
48 elem
-> q_forw
-> q_back
= elem
-> q_back
;
49 elem
-> q_back
-> q_forw
= elem
-> q_forw
;