Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XFlush(XS) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

AllPlanes(XS)

XIfEvent(XS)

XNextEvent(XS)

XPutBackEvent(XS)


 XFlush(XS)        X Version 11 (Release 5) 6 January 1993         XFlush(XS)


 Name

    XFlush - handle output buffer or event queue

 Syntax


    XFlush(display)
          Display *display;

    XSync(display, discard)
          Display *display;
          Bool discard;

    int XEventsQueued(display, mode)
          Display *display;
          int mode;

    int XPending(display)
          Display *display;


 Arguments


    discard   Specifies a Boolean value that indicates whether XSync discards
              all events on the event queue.

    display   Specifies the connection to the X server.

    mode      Specifies the mode.  You can pass QueuedAlready, QueuedAfter-
              Flush, or QueuedAfterReading.

 Description

    The XFlush function flushes the output buffer.  Most client applications
    need not use this function because the output buffer is automatically
    flushed as needed by calls to XPending, XNextEvent, and XWindowEvent.
    Events generated by the server may be enqueued into the library's event
    queue.

    The XSync function flushes the output buffer and then waits until all
    requests have been received and processed by the X server.  Any errors
    generated must be handled by the error handler.  For each protocol error
    received by Xlib, XSync calls the client application's error handling
    routine (see section 11.8.2 of Xlib - C Language X Interface).  Any
    events generated by the server are enqueued into the library's event
    queue.

    Finally, if you passed False, XSync does not discard the events in the
    queue.  If you passed True, XSync discards all events in the queue,
    including those events that were on the queue before XSync was called.
    Client applications seldom need to call XSync.

    If mode is QueuedAlready, XEventsQueued returns the number of events
    already in the event queue (and never performs a system call).  If mode
    is QueuedAfterFlush, XEventsQueued returns the number of events already
    in the queue if the number is nonzero.  If there are no events in the
    queue, XEventsQueued flushes the output buffer, attempts to read more
    events out of the application's connection, and returns the number read.
    If mode is QueuedAfterReading, XEventsQueued returns the number of events
    already in the queue if the number is nonzero.  If there are no events in
    the queue, XEventsQueued attempts to read more events out of the
    application's connection without flushing the output buffer and returns
    the number read.

    XEventsQueued always returns immediately without I/O if there are events
    already in the queue.  XEventsQueued with mode QueuedAfterFlush is ident-
    ical in behavior to XPending.  XEventsQueued with mode QueuedAlready is
    identical to the XQLength function.

    The XPending function returns the number of events that have been
    received from the X server but have not been removed from the event
    queue.  XPending is identical to XEventsQueued with the mode QueuedAfter-
    Flush specified.

 See also

    AllPlanes(XS), XIfEvent(XS), XNextEvent(XS), XPutBackEvent(XS)
    Xlib - C Language X Interface


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026