


XFlush(3X11)							 XFlush(3X11)
X11R5									X11R5



NAME
  XFlush, XSync, XEventsQueued,	XPending - handle output buffer	or event
  queue

SYNTAX
  XFlush(_d_i_s_p_l_a_y)
	Display	*_d_i_s_p_l_a_y;

  XSync(_d_i_s_p_l_a_y, _d_i_s_c_a_r_d)
	Display	*_d_i_s_p_l_a_y;
	Bool _d_i_s_c_a_r_d;

  int XEventsQueued(_d_i_s_p_l_a_y, _m_o_d_e)
       Display *_d_i_s_p_l_a_y;
       int _m_o_d_e;

  int XPending(_d_i_s_p_l_a_y)
	Display	*_d_i_s_p_l_a_y;

ARGUMENTS

  _d_i_s_c_a_r_d   Specifies a	Boolean	value that indicates whether _X_S_y_n_c discards
	    all	events on the event queue.

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _m_o_d_e	    Specifies the mode.	 You can pass _Q_u_e_u_e_d_A_l_r_e_a_d_y, _Q_u_e_u_e_d_A_f_t_e_r_-
	    _F_l_u_s_h, or _Q_u_e_u_e_d_A_f_t_e_r_R_e_a_d_i_n_g.

DESCRIPTION
  The _X_F_l_u_s_h 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	_X_P_e_n_d_i_n_g, _X_N_e_x_t_E_v_e_n_t, and _X_W_i_n_d_o_w_E_v_e_n_t.
  Events generated by the server may be	enqueued into the library's event
  queue.

  The _X_S_y_n_c function flushes the output	buffer and then	waits until all
  requests have	been received and processed by the X server.  Any errors gen-
  erated must be handled by the	error handler.	For each protocol error
  received by Xlib, _X_S_y_n_c calls	the client application's error handling	rou-
  tine (see section 11.8.2).  Any events generated by the server are enqueued
  into the library's event queue.

  Finally, if you passed _F_a_l_s_e,	_X_S_y_n_c does not discard the events in the
  queue.  If you passed	_T_r_u_e, _X_S_y_n_c discards all events	in the queue, includ-
  ing those events that	were on	the queue before _X_S_y_n_c was called.  Client
  applications seldom need to call _X_S_y_n_c.

  If mode is _Q_u_e_u_e_d_A_l_r_e_a_d_y, _X_E_v_e_n_t_s_Q_u_e_u_e_d returns the number of	events
  already in the event queue (and never	performs a system call).  If mode is
  _Q_u_e_u_e_d_A_f_t_e_r_F_l_u_s_h, _X_E_v_e_n_t_s_Q_u_e_u_e_d returns the number of	events already in the
  queue	if the number is nonzero.  If there are	no events in the queue,
  _X_E_v_e_n_t_s_Q_u_e_u_e_d	flushes	the output buffer, attempts to read more events	out
  of the application's connection, and returns the number read.	 If mode is
  _Q_u_e_u_e_d_A_f_t_e_r_R_e_a_d_i_n_g, _X_E_v_e_n_t_s_Q_u_e_u_e_d returns the	number of events already in
  the queue if the number is nonzero. If there are no events in	the queue,
  _X_E_v_e_n_t_s_Q_u_e_u_e_d	attempts to read more events out of the	application's connec-
  tion without flushing	the output buffer and returns the number read.

  _X_E_v_e_n_t_s_Q_u_e_u_e_d	always returns immediately without I/O if there	are events
  already in the queue.	 _X_E_v_e_n_t_s_Q_u_e_u_e_d with mode _Q_u_e_u_e_d_A_f_t_e_r_F_l_u_s_h is identi-
  cal in behavior to _X_P_e_n_d_i_n_g.	_X_E_v_e_n_t_s_Q_u_e_u_e_d with mode	_Q_u_e_u_e_d_A_l_r_e_a_d_y is
  identical to the _X_Q_L_e_n_g_t_h function.

  The _X_P_e_n_d_i_n_g function	returns	the number of events that have been received
  from the X server but	have not been removed from the event queue.  _X_P_e_n_d_i_n_g
  is identical to _X_E_v_e_n_t_s_Q_u_e_u_e_d	with the mode _Q_u_e_u_e_d_A_f_t_e_r_F_l_u_s_h specified.

SEE ALSO
  AllPlanes(3X11), XIfEvent(3X11), XNextEvent(3X11), XPutBackEvent(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e	delim off





















































