-XCBConnection *XCBConnect(const char *displayname, int *screenp)
-{
- int fd, display = 0;
- char *host;
- XCBConnection *c;
- XCBAuthInfo auth;
-
- if(!XCBParseDisplay(displayname, &host, &display, screenp))
- return 0;
- fd = _xcb_open(host, display);
- free(host);
- if(fd == -1)
- return 0;
-
- _xcb_get_auth_info(fd, &auth);
- c = XCBConnectToFD(fd, &auth);
- free(auth.name);
- free(auth.data);
- return c;
-}
-
-XCBConnection *XCBConnectToDisplayWithAuthInfo(const char *displayname, XCBAuthInfo *auth, int *screenp)
-{
- int fd, display = 0;
- char *host;
-
- if(!XCBParseDisplay(displayname, &host, &display, screenp))
- return 0;
- fd = _xcb_open(host, display);
- free(host);
- if(fd == -1)
- return 0;
-
- return XCBConnectToFD(fd, auth);
-}
-
-/* backwards compatible interfaces: remove before 1.0 release */
-int XCBSync(XCBConnection *c, XCBGenericError **e)
-{
- XCBGetInputFocusRep *reply = XCBGetInputFocusReply(c, XCBGetInputFocus(c), e);
- free(reply);
- return reply != 0;
-}
-
-XCBConnection *XCBConnectBasic()
-{
- XCBConnection *c = XCBConnect(0, 0);
- if(c)
- return c;
- perror("XCBConnect");
- abort();
-}
-
-int XCBOpen(const char *host, const int display)
-{
- return _xcb_open(host, display);
-}
-
-int XCBOpenTCP(const char *host, const unsigned short port)
-{
- return _xcb_open_tcp(host, port);
-}