Function xcb::ffi::base::xcb_connect[][src]

pub unsafe extern "C" fn xcb_connect(
    displayname: *const c_char,
    screenp: *mut c_int
) -> *mut xcb_connection_t

Connects to the X server. displayname: The name of the display. screenp: A pointer to a preferred screen number. Returns A newly allocated xcb_connection_t structure.

Connects to the X server specified by displayname. If displayname is NULL, uses the value of the DISPLAY environment variable. If a particular screen on that server is preferred, the int pointed to by screenp (if not NULL) will be set to that screen; otherwise the screen will be set to 0.

Always returns a non-NULL pointer to a xcb_connection_t, even on failure. Callers need to use xcb_connection_has_error() to check for failure. When finished, use xcb_disconnect() to close the connection and free the structure.