comparison src/console-stream.c @ 12:bcdc7deadc19 r19-15b7

Import from CVS: tag r19-15b7
author cvs
date Mon, 13 Aug 2007 08:48:16 +0200
parents 376386a54a3c
children 0293115a14e9
comparison
equal deleted inserted replaced
11:91ffe8bd52e4 12:bcdc7deadc19
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 extern Lisp_Object Vstdio_str; /* in console-tty.c */ 45 Lisp_Object Vstdio_str;
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 static Lisp_Object 127 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 return tty_semi_canonicalize_console_connection (connection, errb); 131 if (NILP (connection))
132 } 132 return Vstdio_str;
133 133
134 static Lisp_Object 134 return connection;
135 }
136
137 Lisp_Object
135 stream_canonicalize_console_connection (Lisp_Object connection, 138 stream_canonicalize_console_connection (Lisp_Object connection,
136 Error_behavior errb) 139 Error_behavior errb)
137 { 140 {
138 return tty_canonicalize_console_connection (connection, errb); 141 if (NILP (connection) || !NILP (Fequal (connection, Vstdio_str)))
139 } 142 return Vstdio_str;
140 143
141 static Lisp_Object 144 if (!ERRB_EQ (errb, ERROR_ME))
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
142 stream_semi_canonicalize_device_connection (Lisp_Object connection, 156 stream_semi_canonicalize_device_connection (Lisp_Object connection,
143 Error_behavior errb) 157 Error_behavior errb)
144 { 158 {
145 return tty_semi_canonicalize_device_connection (connection, errb); 159 return stream_semi_canonicalize_console_connection (connection, errb);
146 } 160 }
147 161
148 static Lisp_Object 162 Lisp_Object
149 stream_canonicalize_device_connection (Lisp_Object connection, 163 stream_canonicalize_device_connection (Lisp_Object connection,
150 Error_behavior errb) 164 Error_behavior errb)
151 { 165 {
152 return tty_canonicalize_device_connection (connection, errb); 166 return stream_canonicalize_console_connection (connection, errb);
153 } 167 }
154 168
155 169
156 static void 170 static void
157 stream_init_frame_1 (struct frame *f, Lisp_Object props) 171 stream_init_frame_1 (struct frame *f, Lisp_Object props)
315 329
316 DEFVAR_LISP ("terminal-frame", &Vterminal_frame /* 330 DEFVAR_LISP ("terminal-frame", &Vterminal_frame /*
317 The initial frame-object, which represents Emacs's stdout. 331 The initial frame-object, which represents Emacs's stdout.
318 */ ); 332 */ );
319 Vterminal_frame = Qnil; 333 Vterminal_frame = Qnil;
334
335 /* Moved from console-tty.c */
336 Vstdio_str = build_string ("stdio");
337 staticpro (&Vstdio_str);
320 } 338 }
321 339
322 void 340 void
323 init_console_stream (void) 341 init_console_stream (void)
324 { 342 {