NAME

XAddConnectionWatch, XRemoveConnectionWatch, XProcessInternalConnection, XInternalConnectionNumbers - handle Xlib internal connections

SYNTAX

typedef void (*XConnectionWatchProc)(Display *_d_i_s_p_l_a_y, XPointer _c_l_i_e_n_t___d_a_t_a, int _f_d, Bool _o_p_e_n_i_n_g, XPointer *_w_a_t_c_h___d_a_t_a); Status XAddConnectionWatch(Display *_d_i_s_p_l_a_y, XWatchProc _p_r_o_c_e_d_u_r_e, XPointer _c_l_i_e_n_t___d_a_t_a); Status XRemoveConnectionWatch(Display *_d_i_s_p_l_a_y, XWatchProc _p_r_o_c_e_d_u_r_e, XPointer _c_l_i_e_n_t___d_a_t_a); void XProcessInternalConnection(Display *_d_i_s_p_l_a_y, int _f_d); Status XInternalConnectionNumbers(Display *_d_i_s_p_l_a_y, int **_f_d___r_e_t_u_r_n, int *_c_o_u_n_t___r_e_t_u_r_n);

ARGUMENTS

_c_l_i_e_n_t___d_a_t_a Specifies the additional client data.
_c_o_u_n_t___r_e_t_u_r_n Returns the number of file descriptors.
_d_i_s_p_l_a_y Specifies the connection to the X server.
_f_d Specifies the file descriptor.
_f_d___r_e_t_u_r_n Returns the file descriptors.
_p_r_o_c_e_d_u_r_e Specifies the procedure to be called.

DESCRIPTION

The _X_A_d_d_C_o_n_n_e_c_t_i_o_n_W_a_t_c_h function registers a procedure to be called each time Xlib opens or closes an internal connection for the specified display. The procedure is passed the display, the specified client_data, the file descriptor for the connection, a Boolean indicating whether the connection is being opened or closed, and a pointer to a location for private watch data. If opening is _T_r_u_e, the procedure can store a pointer to private data in the location pointed to by watch_data; when the procedure is later called for this same connection and opening is _F_a_l_s_e, the location pointed to by watch_data will hold this same private data pointer.

This function can be called at any time after a display is opened. If internal connections already exist, the registered procedure will immediately be called for each of them, before _X_A_d_d_C_o_n_n_e_c_t_i_o_n_W_a_t_c_h returns. _X_A_d_d_C_o_n_n_e_c_t_i_o_n_W_a_t_c_h returns a nonzero status if the procedure is successfully registered; otherwise, it returns zero.

The registered procedure should not call any Xlib functions. If the procedure directly or indirectly causes the state of internal connections or watch procedures to change, the result is not defined. If Xlib has been initialized for threads, the procedure is called with the display locked and the result of a call by the procedure to any Xlib function that locks the display is not defined unless the executing thread has externally locked the display using _X_L_o_c_k_D_i_s_p_l_a_y.

The _X_R_e_m_o_v_e_C_o_n_n_e_c_t_i_o_n_W_a_t_c_h function removes a previously registered connection watch procedure. The client_data must match the client_data used when the procedure was initially registered.

The _X_P_r_o_c_e_s_s_I_n_t_e_r_n_a_l_C_o_n_n_e_c_t_i_o_n function processes input available on an internal connection. This function should be called for an internal connection only after an operating system facility (for example, _s_e_l_e_c_t or _p_o_l_l) has indicated that input is available; otherwise, the effect is not defined.

The _X_I_n_t_e_r_n_a_l_C_o_n_n_e_c_t_i_o_n_N_u_m_b_e_r_s function returns a list of the file descriptors for all internal connections currently open for the specified display. When the allocated list is no longer needed, free it by using _X_F_r_e_e. This functions returns a nonzero status if the list is successfully allocated; otherwise, it returns zero.

SEE ALSO

_X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e