XFlush(3X) — X Version 11
NAME
XFlush, XSync, XEventsQueued, XPending, XNextEvent, XPeekEvent − basic error handling
SYNTAX
XFlush(display)
Display ∗display;
XSync(display, discard)
Display ∗display;
int discard;
int XEventQueued(display, more)
Display ∗display;
int mode;
int XPending(display)
Display ∗display;
XNextEvent(display, event_return)
Display ∗display;
XEvent ∗event_return;
XPeekEvent(display, event_return)
Display ∗display;
XEvent ∗event_return;
ARGUMENTS
discardSpecifies whether XSync discards all events on the event queue. You can pass the value 0 or 1.
displaySpecifies the connection to the X server.
event_returnThe function copies the event’s associated structure into this client-supplied structure.
modeSpecifies the mode. You can specify one of these constants: QueuedAlready, QueuedAfterFlush, QueuedAfterReading.
DESCRIPTION
The XFlush function flushes the output buffer.
The XSync function flushes the output buffer and then waits until all requests have been received and processed by the X server.
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, it returns the number of events already in the queue, if it is nonzero. If there are no events in the queue, it flushes the output buffer, attempts to read more events out of the application’s connection, and returns the number read. If mode is QueuedAfterReading, it returns the number of events already in the queue, if it is nonzero. If there are no events in the queue, it attempts to read more events out of the application’s connection without flushing the output buffer and returns the number read.
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.
The XNextEvent function copies the first event from the event queue into the specified XEvent structure and then removes it from the queue.
The XPeekEvent function returns the first event from the event queue, but it does not remove the event from the queue.
SEE ALSO
XIfEvent(3X), XPutBackEvent(3X)
Xlib − C Language X Interface
1 March 1988