Annotation of 43BSD/contrib/X/Xlib/XMaskEvent.c, revision 1.1

1.1     ! root        1: #include <X/mit-copyright.h>
        !             2: 
        !             3: /* $Header: XMaskEvent.c,v 10.4 86/02/01 15:37:05 tony Rel $ */
        !             4: /* Copyright    Massachusetts Institute of Technology    1985  */
        !             5: 
        !             6: #include "XlibInternal.h"
        !             7: 
        !             8: extern _QEvent *_qfree;
        !             9: 
        !            10: /* 
        !            11:  * Flush output and (wait for and) return the next event in the queue
        !            12:  * matching one of the events in the mask.
        !            13:  * Events earlier in the queue are not discarded.
        !            14:  */
        !            15: 
        !            16: XMaskEvent (mask, event)
        !            17:        int mask;               /* Selected event mask. */
        !            18:        register XEvent *event; /* XEvent to be filled in. */
        !            19: {
        !            20:        register Display *dpy;
        !            21:        register _QEvent *prev, *qelt;
        !            22: 
        !            23:        dpy = _XlibCurrentDisplay;
        !            24:        _XFlush (dpy);
        !            25:        for (prev = NULL, qelt = dpy->head;
        !            26:             qelt &&  !(qelt->event.type & mask);
        !            27:             qelt = (prev = qelt)->next) ;
        !            28:        if (qelt) {
        !            29:            *event = qelt->event;
        !            30:            if (prev) {
        !            31:                if ((prev->next = qelt->next) == NULL)
        !            32:                    dpy->tail = prev;
        !            33:            } else {
        !            34:                if ((dpy->head = qelt->next) == NULL)
        !            35:                    dpy->tail = NULL;
        !            36:            }
        !            37:            qelt->next = _qfree;
        !            38:            _qfree = qelt;
        !            39:            dpy->qlen--;
        !            40:            return;
        !            41:        }
        !            42:        while (1) {
        !            43:            _XRead (dpy, event, sizeof(XEvent));
        !            44:            if (event->type == X_Error)
        !            45:                _XError(dpy, (XErrorEvent *) event);
        !            46:            else if (event->type & mask)
        !            47:                return;
        !            48:            else
        !            49:                _XEnq(dpy, event);
        !            50:        }
        !            51: }
        !            52: 

unix.superglobalmegacorp.com

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