comparison src/console-x.c @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 376386a54a3c
children 3d6bfa290dbd
comparison
equal deleted inserted replaced
15:ad457d5f7d04 16:0293115a14e9
44 split_up_display_spec (Lisp_Object display, int *hostname_length, 44 split_up_display_spec (Lisp_Object display, int *hostname_length,
45 int *display_length, int *screen_length) 45 int *display_length, int *screen_length)
46 { 46 {
47 char *dotptr; 47 char *dotptr;
48 48
49 dotptr = strrchr ((char *) string_data (XSTRING (display)), ':'); 49 dotptr = strrchr ((char *) XSTRING_DATA (display), ':');
50 if (!dotptr) 50 if (!dotptr)
51 { 51 {
52 *hostname_length = string_length (XSTRING (display)); 52 *hostname_length = XSTRING_LENGTH (display);
53 *display_length = 0; 53 *display_length = 0;
54 } 54 }
55 else 55 else
56 { 56 {
57 *hostname_length = dotptr - (char *) string_data (XSTRING (display)); 57 *hostname_length = dotptr - (char *) XSTRING_DATA (display);
58 58
59 dotptr = strchr (dotptr, '.'); 59 dotptr = strchr (dotptr, '.');
60 if (dotptr) 60 if (dotptr)
61 *display_length = (dotptr - (char *) string_data (XSTRING (display)) 61 *display_length = (dotptr - (char *) XSTRING_DATA (display)
62 - *hostname_length); 62 - *hostname_length);
63 else 63 else
64 *display_length = string_length (XSTRING (display)) - *hostname_length; 64 *display_length = XSTRING_LENGTH (display) - *hostname_length;
65 } 65 }
66 66
67 *screen_length = (string_length (XSTRING (display)) - *display_length 67 *screen_length = (XSTRING_LENGTH (display) - *display_length
68 - *hostname_length); 68 - *hostname_length);
69 } 69 }
70 70
71 /* Remember, in all of the following functions, we have to verify 71 /* Remember, in all of the following functions, we have to verify
72 the integrity of our input, because the generic functions don't. */ 72 the integrity of our input, because the generic functions don't. */
90 else 90 else
91 CHECK_STRING (connection); 91 CHECK_STRING (connection);
92 92
93 split_up_display_spec (connection, &hostname_length, &display_length, 93 split_up_display_spec (connection, &hostname_length, &display_length,
94 &screen_length); 94 &screen_length);
95 connection = make_string (string_data (XSTRING (connection)), 95 connection = make_string (XSTRING_DATA (connection),
96 hostname_length + display_length); 96 hostname_length + display_length);
97 } 97 }
98 98
99 return connection; 99 return connection;
100 } 100 }
179 connection = x_device_to_console_connection (connection, errb); 179 connection = x_device_to_console_connection (connection, errb);
180 180
181 /* Check for a couple of standard special cases */ 181 /* Check for a couple of standard special cases */
182 if (string_byte (XSTRING (connection), 0) == ':') 182 if (string_byte (XSTRING (connection), 0) == ':')
183 connection = concat2 (build_string ("localhost"), connection); 183 connection = concat2 (build_string ("localhost"), connection);
184 else if (!strncmp ((CONST char *) string_data (XSTRING (connection)), 184 else if (!strncmp ((CONST char *) XSTRING_DATA (connection),
185 "unix:", 5)) 185 "unix:", 5))
186 connection = concat2 (build_string ("localhost:"), 186 connection = concat2 (build_string ("localhost:"),
187 Fsubstring (connection, make_int (5), Qnil)); 187 Fsubstring (connection, make_int (5), Qnil));
188 188
189 RETURN_UNGCPRO (connection); 189 RETURN_UNGCPRO (connection);
207 split_up_display_spec (connection, &hostname_length, &display_length, 207 split_up_display_spec (connection, &hostname_length, &display_length,
208 &screen_length); 208 &screen_length);
209 hostname = Fsubstring (connection, Qzero, make_int (hostname_length)); 209 hostname = Fsubstring (connection, Qzero, make_int (hostname_length));
210 hostname = canonicalize_host_name (hostname); 210 hostname = canonicalize_host_name (hostname);
211 connection = concat2 (hostname, 211 connection = concat2 (hostname,
212 make_string (string_data (XSTRING (connection)) 212 make_string (XSTRING_DATA (connection)
213 + hostname_length, display_length)); 213 + hostname_length, display_length));
214 } 214 }
215 215
216 RETURN_UNGCPRO (connection); 216 RETURN_UNGCPRO (connection);
217 } 217 }
258 RETURN_UNGCPRO (Qunbound); 258 RETURN_UNGCPRO (Qunbound);
259 259
260 split_up_display_spec (connection, &hostname_length, &display_length, 260 split_up_display_spec (connection, &hostname_length, &display_length,
261 &screen_length); 261 &screen_length);
262 262
263 screen_str = build_string ((CONST char *) string_data (XSTRING (connection)) 263 screen_str = build_string ((CONST char *) XSTRING_DATA (connection)
264 + hostname_length + display_length); 264 + hostname_length + display_length);
265 connection = x_canonicalize_console_connection (connection, errb); 265 connection = x_canonicalize_console_connection (connection, errb);
266 266
267 RETURN_UNGCPRO (concat2 (connection, screen_str)); 267 RETURN_UNGCPRO (concat2 (connection, screen_str));
268 } 268 }