Lines Matching defs:host
98 * host = <path to socket>
103 static int _xcb_parse_display_path_to_socket(const char *name, char **host, char **protocol,
134 if (host) {
135 *host = strdup(path);
136 if (!*host)
143 if (host)
144 free(*host);
158 static int _xcb_parse_display(const char *name, char **host, char **protocol,
171 return _xcb_parse_display_path_to_socket(name, host, protocol, displayp, screenp);
174 return _xcb_parse_display_path_to_socket(name + 5, host, protocol, displayp, screenp);
214 *host = malloc(len + 1);
215 if(!*host)
217 memcpy(*host, name, len);
218 (*host)[len] = '\0';
233 int xcb_parse_display(const char *name, char **host, int *displayp,
236 return _xcb_parse_display(name, host, NULL, displayp, screenp);
239 static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short port);
247 static int _xcb_open(const char *host, char *protocol, const int display)
261 if (protocol && strcmp("unix", protocol) == 0 && host && host[0] == '/') {
263 filelen = strlen(host) + 1;
269 memcpy(file, host, filelen);
273 /* If protocol or host is "unix", fall through to Unix socket code below */
275 (*host != '\0') && (strcmp("unix",host) != 0))
279 return _xcb_open_tcp(host, protocol, port);
327 if (fd < 0 && !protocol && *host == '\0') {
329 fd = _xcb_open_tcp(host, protocol, port);
368 static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short port)
385 if (*host == '\0')
386 host = "localhost";
398 if(host[0] == '[' && (bracket = strrchr(host, ']')) && bracket[1] == '\0')
401 ++host;
408 if(getaddrinfo(host, service, &hints, &results))
432 if((_h = gethostbyname(host)) == NULL)
528 char *host = NULL;
533 int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
548 fd = _xcb_open(host, protocol, display);
581 free(host);