diff src/device-tty.c @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents e34711681f30
children d1247f3cc363
line wrap: on
line diff
--- a/src/device-tty.c	Sat Dec 26 00:20:27 2009 -0600
+++ b/src/device-tty.c	Sat Dec 26 21:18:49 2009 -0600
@@ -41,13 +41,27 @@
 #include "sysfile.h"
 #include "syssignal.h" /* for SIGWINCH */
 
-Lisp_Object Qinit_pre_tty_win, Qinit_post_tty_win;
+Lisp_Object Qmake_device_early_tty_entry_point;
 
 
+#ifdef NEW_GC
+static const struct memory_description tty_device_data_description_1 [] = {
+  { XD_END }
+};
+
+DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("tty-device", tty_device,
+				      0, tty_device_data_description_1,
+				      Lisp_Tty_Device);
+#endif /* NEW_GC */
+
 static void
 allocate_tty_device_struct (struct device *d)
 {
+#ifdef NEW_GC
+  d->device_data = alloc_lrecord_type (struct tty_device, &lrecord_tty_device);
+#else /* not NEW_GC */
   d->device_data = xnew_and_zero (struct tty_device);
+#endif /* not NEW_GC */
 }
 
 static void
@@ -56,6 +70,10 @@
   struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
   Lisp_Object terminal_type = CONSOLE_TTY_DATA (con)->terminal_type;
 
+  /* Run part of the elisp side of the TTY device initialization.
+     The post-init is run in the tty_finish_init_device() method. */
+  call0 (Qmake_device_early_tty_entry_point);
+
   DEVICE_INFD (d) = CONSOLE_TTY_DATA (con)->infd;
   DEVICE_OUTFD (d) = CONSOLE_TTY_DATA (con)->outfd;
 
@@ -91,12 +109,9 @@
     }
 
   init_one_device (d);
-
-  /* Run part of the elisp side of the TTY device initialization.
-     The post-init is run in the tty_after_init_frame() method. */
-  call0 (Qinit_pre_tty_win);
 }
 
+#ifndef NEW_GC
 static void
 free_tty_device_struct (struct device *d)
 {
@@ -109,6 +124,7 @@
 {
   free_tty_device_struct (d);
 }
+#endif /* not NEW_GC */
 
 #ifdef SIGWINCH
 
@@ -189,8 +205,11 @@
 void
 syms_of_device_tty (void)
 {
-  DEFSYMBOL (Qinit_pre_tty_win);
-  DEFSYMBOL (Qinit_post_tty_win);
+#ifdef NEW_GC
+  INIT_LISP_OBJECT (tty_device);
+#endif /* NEW_GC */
+
+  DEFSYMBOL (Qmake_device_early_tty_entry_point);
 }
 
 void
@@ -198,7 +217,9 @@
 {
   /* device methods */
   CONSOLE_HAS_METHOD (tty, init_device);
+#ifndef NEW_GC
   CONSOLE_HAS_METHOD (tty, delete_device);
+#endif /* not NEW_GC */
 #ifdef SIGWINCH
   CONSOLE_HAS_METHOD (tty, asynch_device_change);
 #endif /* SIGWINCH */