Mercurial > hg > xemacs-beta
comparison src/device-tty.c @ 3092:141c2920ea48
[xemacs-hg @ 2005-11-25 01:41:31 by crestani]
Incremental Garbage Collector
author | crestani |
---|---|
date | Fri, 25 Nov 2005 01:42:08 +0000 |
parents | 3d8143fc88e1 |
children | e34711681f30 |
comparison
equal
deleted
inserted
replaced
3091:c22d8984148c | 3092:141c2920ea48 |
---|---|
42 #include "syssignal.h" /* for SIGWINCH */ | 42 #include "syssignal.h" /* for SIGWINCH */ |
43 | 43 |
44 Lisp_Object Qinit_pre_tty_win, Qinit_post_tty_win; | 44 Lisp_Object Qinit_pre_tty_win, Qinit_post_tty_win; |
45 | 45 |
46 | 46 |
47 #ifdef NEW_GC | |
48 static const struct memory_description tty_device_data_description_1 [] = { | |
49 { XD_END } | |
50 }; | |
51 | |
52 DEFINE_LRECORD_IMPLEMENTATION ("tty-device", tty_device, | |
53 1, /*dumpable-flag*/ | |
54 0, 0, 0, 0, 0, | |
55 tty_device_data_description_1, | |
56 Lisp_Tty_Device); | |
57 #endif /* NEW_GC */ | |
58 | |
47 static void | 59 static void |
48 allocate_tty_device_struct (struct device *d) | 60 allocate_tty_device_struct (struct device *d) |
49 { | 61 { |
62 #ifdef NEW_GC | |
63 d->device_data = alloc_lrecord_type (struct tty_device, &lrecord_tty_device); | |
64 #else /* not NEW_GC */ | |
50 d->device_data = xnew_and_zero (struct tty_device); | 65 d->device_data = xnew_and_zero (struct tty_device); |
66 #endif /* not NEW_GC */ | |
51 } | 67 } |
52 | 68 |
53 static void | 69 static void |
54 tty_init_device (struct device *d, Lisp_Object UNUSED (props)) | 70 tty_init_device (struct device *d, Lisp_Object UNUSED (props)) |
55 { | 71 { |
95 /* Run part of the elisp side of the TTY device initialization. | 111 /* Run part of the elisp side of the TTY device initialization. |
96 The post-init is run in the tty_after_init_frame() method. */ | 112 The post-init is run in the tty_after_init_frame() method. */ |
97 call0 (Qinit_pre_tty_win); | 113 call0 (Qinit_pre_tty_win); |
98 } | 114 } |
99 | 115 |
116 #ifndef NEW_GC | |
100 static void | 117 static void |
101 free_tty_device_struct (struct device *d) | 118 free_tty_device_struct (struct device *d) |
102 { | 119 { |
103 if (d->device_data) | 120 if (d->device_data) |
104 xfree (d->device_data, void *); | 121 xfree (d->device_data, void *); |
107 static void | 124 static void |
108 tty_delete_device (struct device *d) | 125 tty_delete_device (struct device *d) |
109 { | 126 { |
110 free_tty_device_struct (d); | 127 free_tty_device_struct (d); |
111 } | 128 } |
129 #endif /* not NEW_GC */ | |
112 | 130 |
113 #ifdef SIGWINCH | 131 #ifdef SIGWINCH |
114 | 132 |
115 static SIGTYPE | 133 static SIGTYPE |
116 tty_device_size_change_signal (int UNUSED (signo)) | 134 tty_device_size_change_signal (int UNUSED (signo)) |
187 /************************************************************************/ | 205 /************************************************************************/ |
188 | 206 |
189 void | 207 void |
190 syms_of_device_tty (void) | 208 syms_of_device_tty (void) |
191 { | 209 { |
210 #ifdef NEW_GC | |
211 INIT_LRECORD_IMPLEMENTATION (tty_device); | |
212 #endif /* NEW_GC */ | |
213 | |
192 DEFSYMBOL (Qinit_pre_tty_win); | 214 DEFSYMBOL (Qinit_pre_tty_win); |
193 DEFSYMBOL (Qinit_post_tty_win); | 215 DEFSYMBOL (Qinit_post_tty_win); |
194 } | 216 } |
195 | 217 |
196 void | 218 void |
197 console_type_create_device_tty (void) | 219 console_type_create_device_tty (void) |
198 { | 220 { |
199 /* device methods */ | 221 /* device methods */ |
200 CONSOLE_HAS_METHOD (tty, init_device); | 222 CONSOLE_HAS_METHOD (tty, init_device); |
223 #ifndef NEW_GC | |
201 CONSOLE_HAS_METHOD (tty, delete_device); | 224 CONSOLE_HAS_METHOD (tty, delete_device); |
225 #endif /* not NEW_GC */ | |
202 #ifdef SIGWINCH | 226 #ifdef SIGWINCH |
203 CONSOLE_HAS_METHOD (tty, asynch_device_change); | 227 CONSOLE_HAS_METHOD (tty, asynch_device_change); |
204 #endif /* SIGWINCH */ | 228 #endif /* SIGWINCH */ |
205 CONSOLE_HAS_METHOD (tty, device_system_metrics); | 229 CONSOLE_HAS_METHOD (tty, device_system_metrics); |
206 } | 230 } |