Annotation of xinu/h/q.h, revision 1.1.1.2

1.1       root        1: /* q.h - firstid, firstkey, isempty, lastkey, nonempty */
                      2: 
                      3: /* q structure declarations, constants, and inline procedures          */
                      4: 
                      5: #ifndef        NQENT
                      6: #define        NQENT           NPROC + NSEM + NSEM + 4 /* for ready & sleep    */
                      7: #endif
                      8: 
                      9: struct qent    {               /* one for each process plus two for    */
                     10:                                /* each list                            */
1.1.1.2 ! root       11:        int     qkey;           /* key on which the queue is ordered    */
        !            12:        int     qnext;          /* pointer to next process or tail      */
        !            13:        int     qprev;          /* pointer to previous process or head  */
1.1       root       14:        };
                     15: 
                     16: extern struct  qent q[];
                     17: extern int     nextqueue;
                     18: 
                     19: /* inline list manipulation procedures */
                     20: 
                     21: #define        isempty(list)   (q[(list)].qnext >= NPROC)
                     22: #define        nonempty(list)  (q[(list)].qnext < NPROC)
                     23: #define        firstkey(list)  (q[q[(list)].qnext].qkey)
                     24: #define lastkey(tail)  (q[q[(tail)].qprev].qkey)
                     25: #define firstid(list)  (q[(list)].qnext)
                     26: 
                     27: #define        EMPTY   -1              /* equivalent of null pointer           */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.