comparison src/console.c @ 5117:3742ea8250b5 ben-lisp-object ben-lisp-object-final-ws-year-2005

Checking in final CVS version of workspace 'ben-lisp-object'
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 00:20:27 -0600
parents facf3239ba30
children e0db3c197671
comparison
equal deleted inserted replaced
5116:e56f73345619 5117:3742ea8250b5
170 write_fmt_string_lisp (printcharfun, " on %S", 1, 170 write_fmt_string_lisp (printcharfun, " on %S", 1,
171 CONSOLE_CONNECTION (con)); 171 CONSOLE_CONNECTION (con));
172 write_fmt_string (printcharfun, " 0x%x>", con->header.uid); 172 write_fmt_string (printcharfun, " 0x%x>", con->header.uid);
173 } 173 }
174 174
175 DEFINE_LRECORD_IMPLEMENTATION ("console", console, 175 DEFINE_NONDUMPABLE_LISP_OBJECT ("console", console, mark_console,
176 0, /*dumpable-flag*/ 176 print_console, 0, 0, 0,
177 mark_console, print_console, 0, 0, 0, 177 console_description,
178 console_description, 178 struct console);
179 struct console);
180 179
181 180
182 static void 181 static void
183 set_quit_events (struct console *con, Lisp_Object key) 182 set_quit_events (struct console *con, Lisp_Object key)
184 { 183 {
191 } 190 }
192 191
193 static struct console * 192 static struct console *
194 allocate_console (Lisp_Object type) 193 allocate_console (Lisp_Object type)
195 { 194 {
196 Lisp_Object console; 195 Lisp_Object console = ALLOC_LISP_OBJECT (console);
197 struct console *con = ALLOC_LCRECORD_TYPE (struct console, &lrecord_console); 196 struct console *con = XCONSOLE (console);
198 struct gcpro gcpro1; 197 struct gcpro gcpro1;
199 198
200 COPY_LCRECORD (con, XCONSOLE (Vconsole_defaults)); 199 COPY_LCRECORD (con, XCONSOLE (Vconsole_defaults));
201 200
202 console = wrap_console (con);
203 GCPRO1 (console); 201 GCPRO1 (console);
204 202
205 con->conmeths = decode_console_type (type, ERROR_ME); 203 con->conmeths = decode_console_type (type, ERROR_ME);
206 con->contype = get_console_variant (type); 204 con->contype = get_console_variant (type);
207 con->command_builder = allocate_command_builder (console, 1); 205 con->command_builder = allocate_command_builder (console, 1);
1186 /************************************************************************/ 1184 /************************************************************************/
1187 1185
1188 void 1186 void
1189 syms_of_console (void) 1187 syms_of_console (void)
1190 { 1188 {
1191 INIT_LRECORD_IMPLEMENTATION (console); 1189 INIT_LISP_OBJECT (console);
1192 1190
1193 DEFSUBR (Fvalid_console_type_p); 1191 DEFSUBR (Fvalid_console_type_p);
1194 DEFSUBR (Fconsole_type_list); 1192 DEFSUBR (Fconsole_type_list);
1195 DEFSUBR (Fcdfw_console); 1193 DEFSUBR (Fcdfw_console);
1196 DEFSUBR (Fselected_console); 1194 DEFSUBR (Fselected_console);
1315 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magic_fun) \ 1313 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magic_fun) \
1316 do { \ 1314 do { \
1317 struct symbol_value_forward *I_hate_C = \ 1315 struct symbol_value_forward *I_hate_C = \
1318 alloc_lrecord_type (struct symbol_value_forward, \ 1316 alloc_lrecord_type (struct symbol_value_forward, \
1319 &lrecord_symbol_value_forward); \ 1317 &lrecord_symbol_value_forward); \
1320 /*mcpro ((Lisp_Object) I_hate_C);*/ \ 1318 /*mcpro ((Lisp_Object) I_hate_C);*/ \
1321 \ 1319 \
1322 I_hate_C->magic.value = &(console_local_flags.field_name); \ 1320 I_hate_C->magic.value = &(console_local_flags.field_name); \
1323 I_hate_C->magic.type = forward_type; \ 1321 I_hate_C->magic.type = forward_type; \
1324 I_hate_C->magicfun = magic_fun; \ 1322 I_hate_C->magicfun = magic_fun; \
1325 \ 1323 \
1391 common_init_complex_vars_of_console (void) 1389 common_init_complex_vars_of_console (void)
1392 { 1390 {
1393 /* Make sure all markable slots in console_defaults 1391 /* Make sure all markable slots in console_defaults
1394 are initialized reasonably, so mark_console won't choke. 1392 are initialized reasonably, so mark_console won't choke.
1395 */ 1393 */
1396 struct console *defs = ALLOC_LCRECORD_TYPE (struct console, &lrecord_console); 1394 Lisp_Object defobj = ALLOC_LISP_OBJECT (console);
1397 struct console *syms = ALLOC_LCRECORD_TYPE (struct console, &lrecord_console); 1395 struct console *defs = XCONSOLE (defobj);
1396 Lisp_Object symobj = ALLOC_LISP_OBJECT (console);
1397 struct console *syms = XCONSOLE (symobj);
1398 1398
1399 staticpro_nodump (&Vconsole_defaults); 1399 staticpro_nodump (&Vconsole_defaults);
1400 staticpro_nodump (&Vconsole_local_symbols); 1400 staticpro_nodump (&Vconsole_local_symbols);
1401 Vconsole_defaults = wrap_console (defs); 1401 Vconsole_defaults = defobj;
1402 Vconsole_local_symbols = wrap_console (syms); 1402 Vconsole_local_symbols = symobj;
1403 1403
1404 nuke_all_console_slots (syms, Qnil); 1404 nuke_all_console_slots (syms, Qnil);
1405 nuke_all_console_slots (defs, Qnil); 1405 nuke_all_console_slots (defs, Qnil);
1406 1406
1407 /* Set up the non-nil default values of various console slots. 1407 /* Set up the non-nil default values of various console slots.