Q U E U E
Queue Handling Routines
- Taken from smartall by John Walker.
+ Taken from smartall written by John Walker.
http://www.fourmilab.ch/smartall/
+
+ Version $Id$
+
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
};
#endif
-/*
+/*
* To define a queue, use the following
*
- * static BQUEUE xyz = { &xyz, &xyz };
+ * static BQUEUE xyz = { &xyz, &xyz };
*
* Also, note, that the only real requirement is that
* the object that is passed to these routines contain
/* QREMOVE -- Remove next object from the queue given
- the queue head (or any item).
+ the queue head (or any item).
Returns NULL if queue is empty */
BQUEUE *qremove(BQUEUE *qhead)
qitem = qhead;
ASSERT(qi->qprev->qnext == qi);
ASSERT(qi->qnext->qprev == qi);
-
+
if ((object = qi->qnext) == qh)
return NULL;
return object;
#undef qh
#undef qi
-}
+}
/* QDCHAIN -- Dequeue an item from the middle of a queue. Passed