1XAddConnectionWatch(3)          XLIB FUNCTIONS          XAddConnectionWatch(3)
2
3
4

NAME

6       XAddConnectionWatch,   XRemoveConnectionWatch,  XProcessInternalConnec‐
7       tion, XInternalConnectionNumbers - handle Xlib internal connections
8

SYNTAX

10       typedef   void   (*XConnectionWatchProc)(Display   *display,   XPointer
11              client_data, int fd, Bool opening, XPointer *watch_data);
12
13       Status  XAddConnectionWatch(Display *display, XConnectionWatchProc pro‐
14              cedure, XPointer client_data);
15
16       void XRemoveConnectionWatch(Display *display, XConnectionWatchProc pro‐
17              cedure, XPointer client_data);
18
19       void XProcessInternalConnection(Display *display, int fd);
20
21       Status  XInternalConnectionNumbers(Display  *display,  int **fd_return,
22              int *count_return);
23

ARGUMENTS

25       client_data
26                 Specifies the additional client data.
27
28       count_return
29                 Returns the number of file descriptors.
30
31       display   Specifies the connection to the X server.
32
33       fd        Specifies the file descriptor.
34
35       fd_return Returns the file descriptors.
36
37       procedure Specifies the procedure to be called.
38

DESCRIPTION

40       The XAddConnectionWatch function registers a  procedure  to  be  called
41       each time Xlib opens or closes an internal connection for the specified
42       display.   The  procedure  is  passed  the   display,   the   specified
43       client_data, the file descriptor for the connection, a Boolean indicat‐
44       ing whether the connection is being opened or closed, and a pointer  to
45       a  location  for private watch data.  If opening is True, the procedure
46       can store a pointer to private data  in  the  location  pointed  to  by
47       watch_data; when the procedure is later called for this same connection
48       and opening is False, the location pointed to by watch_data  will  hold
49       this same private data pointer.
50
51       This  function can be called at any time after a display is opened.  If
52       internal connections already exist, the registered procedure will imme‐
53       diately be called for each of them, before XAddConnectionWatch returns.
54       XAddConnectionWatch returns a nonzero status if the procedure  is  suc‐
55       cessfully registered; otherwise, it returns zero.
56
57       The  registered  procedure  should not call any Xlib functions.  If the
58       procedure directly or indirectly causes the state of  internal  connec‐
59       tions  or  watch  procedures  to change, the result is not defined.  If
60       Xlib has been initialized for threads, the procedure is called with the
61       display  locked  and  the result of a call by the procedure to any Xlib
62       function that locks the display is not  defined  unless  the  executing
63       thread has externally locked the display using XLockDisplay.
64
65       The  XRemoveConnectionWatch  function  removes  a previously registered
66       connection watch procedure.  The client_data must match the client_data
67       used when the procedure was initially registered.
68
69
70       The XProcessInternalConnection function processes input available on an
71       internal connection.  This function should be called  for  an  internal
72       connection only after an operating system facility (for example, select
73       or poll) has indicated that input is available; otherwise,  the  effect
74       is not defined.
75
76       The  XInternalConnectionNumbers  function  returns  a  list of the file
77       descriptors for all internal connections currently open for the  speci‐
78       fied  display.  When the allocated list is no longer needed, free it by
79       using XFree.  This functions returns a nonzero status if  the  list  is
80       successfully allocated; otherwise, it returns zero.
81

SEE ALSO

83       Xlib - C Language X Interface
84
85
86
87X Version 11                     libX11 1.6.12          XAddConnectionWatch(3)
Impressum