diff 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
line wrap: on
line diff
--- a/src/console-stream.c	Mon Aug 13 08:47:56 2007 +0200
+++ b/src/console-stream.c	Mon Aug 13 08:48:16 2007 +0200
@@ -42,7 +42,7 @@
 Lisp_Object Vterminal_device;
 Lisp_Object Vterminal_frame;
 
-extern Lisp_Object Vstdio_str; /* in console-tty.c */
+Lisp_Object Vstdio_str;
 
 static void
 allocate_stream_console_struct (struct console *con)
@@ -124,32 +124,46 @@
   free_stream_console_struct (con);
 }
 
-static Lisp_Object
+Lisp_Object
 stream_semi_canonicalize_console_connection (Lisp_Object connection,
 					     Error_behavior errb)
 {
-  return tty_semi_canonicalize_console_connection (connection, errb);
+  if (NILP (connection))
+    return Vstdio_str;
+
+  return connection;
 }
 
-static Lisp_Object
+Lisp_Object
 stream_canonicalize_console_connection (Lisp_Object connection,
 					Error_behavior errb)
 {
-  return tty_canonicalize_console_connection (connection, errb);
+  if (NILP (connection) || !NILP (Fequal (connection, Vstdio_str)))
+    return Vstdio_str;
+
+  if (!ERRB_EQ (errb, ERROR_ME))
+    {
+      if (!STRINGP (connection))
+	return Qunbound;
+    }
+  else
+    CHECK_STRING (connection);
+
+  return Ffile_truename (connection, Qnil);
 }
 
-static Lisp_Object
+Lisp_Object
 stream_semi_canonicalize_device_connection (Lisp_Object connection,
 					    Error_behavior errb)
 {
-  return tty_semi_canonicalize_device_connection (connection, errb);
+  return stream_semi_canonicalize_console_connection (connection, errb);
 }
 
-static Lisp_Object
+Lisp_Object
 stream_canonicalize_device_connection (Lisp_Object connection,
 				       Error_behavior errb)
 {
-  return tty_canonicalize_device_connection (connection, errb);
+  return stream_canonicalize_console_connection (connection, errb);
 }
 
 
@@ -317,6 +331,10 @@
 The initial frame-object, which represents Emacs's stdout.
 */ );
   Vterminal_frame = Qnil;
+
+  /* Moved from console-tty.c */
+  Vstdio_str = build_string ("stdio");
+  staticpro (&Vstdio_str);
 }
 
 void