other operations on the same window to the server. The identifiers are unique to the server. Most of them can be used by different applications to refer to the same objects. For example, two applications connecting with the same server use the same identifier to refer to the same window. These two applications use two different channels, and therefore have two different structures; however, when they request operations on the same identifier, these operations will be done on the same object. Protocol and events The Xlib functions that send requests to the server usually do not send these requests immediately but store them in a buffer, called the request buffer. The term request in this case refers to the request from the client that is directed to the server: the request buffer can contain all kinds of requests to the server, not only those having a visible effect on the screen. The request buffer is guaranteed to be flushed (i.e., all requests done so far are sent to the server) after a call to the functions XSync or XFlush, after a call to a function that returns a value from the server (these functions block until the answer is received), and in some other conditions. Xlib stores the received events in a queue. The client application can inspect and retrieve events from the queue. While the X server sends events asynchronously, applications using the Xlib library are required to explicitly call Xlib functions for accessing the events in the queue. Some of these functions may block; in this case, they also flush the request buffer. Errors are instead received and treated asynchronously: the application can provide an error handler that will be called whenever an error message from the server is received. The content of a window is not guaranteed to be preserved if the window or one of its parts are made not visible. In this case, the application are sent an Expose event when the window of one part of it is made visible again. The application is then supposed to draw the window content again. Functions The functions in the Xlib library can be grouped in: operations on the connection (XOpenDisplay, XCloseDisplay, ...); requests to the server, including requests for operations (XCreateWindow, XCreateGC,...) and requests for information (XGetWindowProperty, ...); and operations that are local to the client: operations on the event queue (XNextEvent, XPeekEvent, ...) and other