Page:Xlib - C Language X Interface.pdf/13



Before your program can use a display, you must establish a connection to the X server. Once you have established a connection, you then can use the Xlib macros and functions discussed in this chapter to return information about the display. This chapter discusses how to:
 * Open (connect to) the display
 * Obtain information about the display, image formats, or screens
 * Generate a NoOperation protocol request
 * Free client-created data
 * Close (disconnect from) a display
 * Use X Server connection close operations
 * Use Xlib with threads
 * Use internal connections

2.1. Opening the Display

To open a connection to the X server that controls a display, use XOpenDisplay.

The encoding and interpretation of the display name are implementation-dependent. Strings in the Host Portable Character Encoding are supported; support for other characters is implementation-dependent. On POSIX-conformant systems, the display name or DISPLAY environment variable can be a string in the format: