|
|
1.1 ! root 1: /* newqueue.c - newqueue */ ! 2: ! 3: #include <conf.h> ! 4: #include <kernel.h> ! 5: #include <q.h> ! 6: ! 7: /*------------------------------------------------------------------------ ! 8: * newqueue -- initialize a new list in the q structure ! 9: *------------------------------------------------------------------------ ! 10: */ ! 11: int newqueue() ! 12: { ! 13: struct qent *hptr; /* address of new list head */ ! 14: struct qent *tptr; /* address of new list tail */ ! 15: int hindex, tindex; /* head and tail indexes */ ! 16: ! 17: hptr = &q[ hindex=nextqueue++ ];/* nextqueue is global variable */ ! 18: tptr = &q[ tindex=nextqueue++ ];/* giving next used q pos. */ ! 19: hptr->qnext = tindex; ! 20: hptr->qprev = EMPTY; ! 21: hptr->qkey = MINSHORT; ! 22: tptr->qnext = EMPTY; ! 23: tptr->qprev = hindex; ! 24: tptr->qkey = MAXSHORT; ! 25: return(hindex); ! 26: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.