comparison src/console.c @ 5140:e5380fdaf8f1

merge
author Ben Wing <ben@xemacs.org>
date Sat, 13 Mar 2010 05:38:34 -0600
parents a9c41067dd88
children f965e31a35f0
comparison
equal deleted inserted replaced
5139:a48ef26d87ee 5140:e5380fdaf8f1
171 write_fmt_string_lisp (printcharfun, " on %S", 1, 171 write_fmt_string_lisp (printcharfun, " on %S", 1,
172 CONSOLE_CONNECTION (con)); 172 CONSOLE_CONNECTION (con));
173 write_fmt_string (printcharfun, " 0x%x>", con->header.uid); 173 write_fmt_string (printcharfun, " 0x%x>", con->header.uid);
174 } 174 }
175 175
176 DEFINE_LRECORD_IMPLEMENTATION ("console", console, 176 DEFINE_NODUMP_LISP_OBJECT ("console", console, mark_console,
177 0, /*dumpable-flag*/ 177 print_console, 0, 0, 0,
178 mark_console, print_console, 0, 0, 0, 178 console_description,
179 console_description, 179 struct console);
180 struct console);
181 180
182 181
183 static void 182 static void
184 set_quit_events (struct console *con, Lisp_Object key) 183 set_quit_events (struct console *con, Lisp_Object key)
185 { 184 {
192 } 191 }
193 192
194 static struct console * 193 static struct console *
195 allocate_console (Lisp_Object type) 194 allocate_console (Lisp_Object type)
196 { 195 {
197 Lisp_Object console; 196 Lisp_Object console = ALLOC_NORMAL_LISP_OBJECT (console);
198 struct console *con = ALLOC_LCRECORD_TYPE (struct console, &lrecord_console); 197 struct console *con = XCONSOLE (console);
199 struct gcpro gcpro1; 198 struct gcpro gcpro1;
200 199
201 COPY_LCRECORD (con, XCONSOLE (Vconsole_defaults)); 200 copy_lisp_object (console, Vconsole_defaults);
202 201
203 console = wrap_console (con);
204 GCPRO1 (console); 202 GCPRO1 (console);
205 203
206 con->conmeths = decode_console_type (type, ERROR_ME); 204 con->conmeths = decode_console_type (type, ERROR_ME);
207 con->contype = get_console_variant (type); 205 con->contype = get_console_variant (type);
208 con->command_builder = allocate_command_builder (console, 1); 206 con->command_builder = allocate_command_builder (console, 1);
661 } 659 }
662 660
663 static void 661 static void
664 nuke_all_console_slots (struct console *con, Lisp_Object zap) 662 nuke_all_console_slots (struct console *con, Lisp_Object zap)
665 { 663 {
666 ZERO_LCRECORD (con); 664 zero_nonsized_lisp_object (wrap_console (con));
667 665
668 #define MARKED_SLOT(x) con->x = zap; 666 #define MARKED_SLOT(x) con->x = zap;
669 #include "conslots.h" 667 #include "conslots.h"
670 } 668 }
671 669
1185 /************************************************************************/ 1183 /************************************************************************/
1186 1184
1187 void 1185 void
1188 syms_of_console (void) 1186 syms_of_console (void)
1189 { 1187 {
1190 INIT_LRECORD_IMPLEMENTATION (console); 1188 INIT_LISP_OBJECT (console);
1191 #ifdef NEW_GC 1189 #ifdef NEW_GC
1192 #ifdef HAVE_TTY 1190 #ifdef HAVE_TTY
1193 INIT_LRECORD_IMPLEMENTATION (tty_console); 1191 INIT_LISP_OBJECT (tty_console);
1194 #endif 1192 #endif
1195 INIT_LRECORD_IMPLEMENTATION (stream_console); 1193 INIT_LISP_OBJECT (stream_console);
1196 #endif /* NEW_GC */ 1194 #endif /* NEW_GC */
1197 1195
1198 DEFSUBR (Fvalid_console_type_p); 1196 DEFSUBR (Fvalid_console_type_p);
1199 DEFSUBR (Fconsole_type_list); 1197 DEFSUBR (Fconsole_type_list);
1200 DEFSUBR (Fcdfw_console); 1198 DEFSUBR (Fcdfw_console);
1318 /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */ 1316 /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */
1319 #ifdef NEW_GC 1317 #ifdef NEW_GC
1320 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magic_fun) \ 1318 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magic_fun) \
1321 do { \ 1319 do { \
1322 struct symbol_value_forward *I_hate_C = \ 1320 struct symbol_value_forward *I_hate_C = \
1323 alloc_lrecord_type (struct symbol_value_forward, \ 1321 XSYMBOL_VALUE_FORWARD (ALLOC_NORMAL_LISP_OBJECT (symbol_value_forward)); \
1324 &lrecord_symbol_value_forward); \ 1322 /*mcpro ((Lisp_Object) I_hate_C);*/ \
1325 /*mcpro ((Lisp_Object) I_hate_C);*/ \
1326 \ 1323 \
1327 I_hate_C->magic.value = &(console_local_flags.field_name); \ 1324 I_hate_C->magic.value = &(console_local_flags.field_name); \
1328 I_hate_C->magic.type = forward_type; \ 1325 I_hate_C->magic.type = forward_type; \
1329 I_hate_C->magicfun = magic_fun; \ 1326 I_hate_C->magicfun = magic_fun; \
1330 \ 1327 \
1396 common_init_complex_vars_of_console (void) 1393 common_init_complex_vars_of_console (void)
1397 { 1394 {
1398 /* Make sure all markable slots in console_defaults 1395 /* Make sure all markable slots in console_defaults
1399 are initialized reasonably, so mark_console won't choke. 1396 are initialized reasonably, so mark_console won't choke.
1400 */ 1397 */
1401 struct console *defs = ALLOC_LCRECORD_TYPE (struct console, &lrecord_console); 1398 Lisp_Object defobj = ALLOC_NORMAL_LISP_OBJECT (console);
1402 struct console *syms = ALLOC_LCRECORD_TYPE (struct console, &lrecord_console); 1399 struct console *defs = XCONSOLE (defobj);
1400 Lisp_Object symobj = ALLOC_NORMAL_LISP_OBJECT (console);
1401 struct console *syms = XCONSOLE (symobj);
1403 1402
1404 staticpro_nodump (&Vconsole_defaults); 1403 staticpro_nodump (&Vconsole_defaults);
1405 staticpro_nodump (&Vconsole_local_symbols); 1404 staticpro_nodump (&Vconsole_local_symbols);
1406 Vconsole_defaults = wrap_console (defs); 1405 Vconsole_defaults = defobj;
1407 Vconsole_local_symbols = wrap_console (syms); 1406 Vconsole_local_symbols = symobj;
1408 1407
1409 nuke_all_console_slots (syms, Qnil); 1408 nuke_all_console_slots (syms, Qnil);
1410 nuke_all_console_slots (defs, Qnil); 1409 nuke_all_console_slots (defs, Qnil);
1411 1410
1412 /* Set up the non-nil default values of various console slots. 1411 /* Set up the non-nil default values of various console slots.
1440 The local flag is a bit that is used in the console 1439 The local flag is a bit that is used in the console
1441 to say that it has its own local value for the slot. 1440 to say that it has its own local value for the slot.
1442 The local flag bits are in the local_var_flags slot of the 1441 The local flag bits are in the local_var_flags slot of the
1443 console. */ 1442 console. */
1444 1443
1444 set_lheader_implementation ((struct lrecord_header *)
1445 &console_local_flags, &lrecord_console);
1445 nuke_all_console_slots (&console_local_flags, make_int (-2)); 1446 nuke_all_console_slots (&console_local_flags, make_int (-2));
1446 console_local_flags.defining_kbd_macro = always_local_resettable; 1447 console_local_flags.defining_kbd_macro = always_local_resettable;
1447 console_local_flags.last_kbd_macro = always_local_resettable; 1448 console_local_flags.last_kbd_macro = always_local_resettable;
1448 console_local_flags.prefix_arg = always_local_resettable; 1449 console_local_flags.prefix_arg = always_local_resettable;
1449 console_local_flags.default_minibuffer_frame = always_local_resettable; 1450 console_local_flags.default_minibuffer_frame = always_local_resettable;