comparison src/console-stream.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents e04119814345
children c7528f8e288d
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
40 40
41 Lisp_Object Vterminal_console; 41 Lisp_Object Vterminal_console;
42 Lisp_Object Vterminal_device; 42 Lisp_Object Vterminal_device;
43 Lisp_Object Vterminal_frame; 43 Lisp_Object Vterminal_frame;
44 44
45 Lisp_Object Vstdio_str; 45 extern Lisp_Object Vstdio_str; /* in console-tty.c */
46 46
47 static void 47 static void
48 allocate_stream_console_struct (struct console *con) 48 allocate_stream_console_struct (struct console *con)
49 { 49 {
50 con->console_data = 50 con->console_data =
122 if (CONSOLE_STREAM_DATA (con)->infd != stdin) 122 if (CONSOLE_STREAM_DATA (con)->infd != stdin)
123 fclose (CONSOLE_STREAM_DATA (con)->infd); 123 fclose (CONSOLE_STREAM_DATA (con)->infd);
124 free_stream_console_struct (con); 124 free_stream_console_struct (con);
125 } 125 }
126 126
127 Lisp_Object 127 static Lisp_Object
128 stream_semi_canonicalize_console_connection (Lisp_Object connection, 128 stream_semi_canonicalize_console_connection (Lisp_Object connection,
129 Error_behavior errb) 129 Error_behavior errb)
130 { 130 {
131 if (NILP (connection)) 131 return tty_semi_canonicalize_console_connection (connection, errb);
132 return Vstdio_str; 132 }
133 133
134 return connection; 134 static Lisp_Object
135 }
136
137 Lisp_Object
138 stream_canonicalize_console_connection (Lisp_Object connection, 135 stream_canonicalize_console_connection (Lisp_Object connection,
139 Error_behavior errb) 136 Error_behavior errb)
140 { 137 {
141 if (NILP (connection) || !NILP (Fequal (connection, Vstdio_str))) 138 return tty_canonicalize_console_connection (connection, errb);
142 return Vstdio_str; 139 }
143 140
144 if (!ERRB_EQ (errb, ERROR_ME)) 141 static Lisp_Object
145 {
146 if (!STRINGP (connection))
147 return Qunbound;
148 }
149 else
150 CHECK_STRING (connection);
151
152 return Ffile_truename (connection, Qnil);
153 }
154
155 Lisp_Object
156 stream_semi_canonicalize_device_connection (Lisp_Object connection, 142 stream_semi_canonicalize_device_connection (Lisp_Object connection,
157 Error_behavior errb) 143 Error_behavior errb)
158 { 144 {
159 return stream_semi_canonicalize_console_connection (connection, errb); 145 return tty_semi_canonicalize_device_connection (connection, errb);
160 } 146 }
161 147
162 Lisp_Object 148 static Lisp_Object
163 stream_canonicalize_device_connection (Lisp_Object connection, 149 stream_canonicalize_device_connection (Lisp_Object connection,
164 Error_behavior errb) 150 Error_behavior errb)
165 { 151 {
166 return stream_canonicalize_console_connection (connection, errb); 152 return tty_canonicalize_device_connection (connection, errb);
167 } 153 }
168 154
169 155
170 static void 156 static void
171 stream_init_frame_1 (struct frame *f, Lisp_Object props) 157 stream_init_frame_1 (struct frame *f, Lisp_Object props)
316 302
317 void 303 void
318 vars_of_console_stream (void) 304 vars_of_console_stream (void)
319 { 305 {
320 DEFVAR_LISP ("terminal-console", &Vterminal_console /* 306 DEFVAR_LISP ("terminal-console", &Vterminal_console /*
321 The initial console-object, which represents XEmacs' stdout. 307 The initial console-object, which represent's Emacs's stdout.
322 */ ); 308 */ );
323 Vterminal_console = Qnil; 309 Vterminal_console = Qnil;
324 310
325 DEFVAR_LISP ("terminal-device", &Vterminal_device /* 311 DEFVAR_LISP ("terminal-device", &Vterminal_device /*
326 The initial device-object, which represents XEmacs' stdout. 312 The initial device-object, which represent's Emacs's stdout.
327 */ ); 313 */ );
328 Vterminal_device = Qnil; 314 Vterminal_device = Qnil;
329 315
330 DEFVAR_LISP ("terminal-frame", &Vterminal_frame /* 316 DEFVAR_LISP ("terminal-frame", &Vterminal_frame /*
331 The initial frame-object, which represents XEmacs' stdout. 317 The initial frame-object, which represents Emacs's stdout.
332 */ ); 318 */ );
333 Vterminal_frame = Qnil; 319 Vterminal_frame = Qnil;
334
335 /* Moved from console-tty.c */
336 Vstdio_str = build_string ("stdio");
337 staticpro (&Vstdio_str);
338 } 320 }
339 321
340 void 322 void
341 init_console_stream (void) 323 init_console_stream (void)
342 { 324 {