Mercurial > hg > xemacs-beta
annotate src/console-stream.c @ 5124:623d57b7fbe8 ben-lisp-object
separate regular and disksave finalization, print method fixes.
Create separate disksave method and make the finalize method only be for
actual object finalization, not disksave finalization.
Fix places where 0 was given in place of a printer -- print methods are
mandatory, and internal objects formerly without a print method now must
explicitly specify internal_object_printer().
Change the defn of CONSOLE_LIVE_P to avoid problems in some weird situations.
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-01-20 Ben Wing <ben@xemacs.org>
* alloc.c:
* alloc.c (very_old_free_lcrecord):
* alloc.c (disksave_object_finalization_1):
* alloc.c (make_lcrecord_list):
* alloc.c (alloc_managed_lcrecord):
* alloc.c (free_managed_lcrecord):
* alloc.c (sweep_lcrecords_1):
* buffer.c:
* bytecode.c:
* bytecode.c (Fcompiled_function_p):
* chartab.c:
* console-impl.h:
* console-impl.h (CONSOLE_TYPE_P):
* console.c:
* console.c (set_quit_events):
* data.c:
* data.c (Fmake_ephemeron):
* database.c:
* database.c (finalize_database):
* database.c (Fclose_database):
* device-msw.c:
* device-msw.c (finalize_devmode):
* device-msw.c (allocate_devmode):
* device.c:
* elhash.c:
* elhash.c (finalize_hash_table):
* eval.c:
* eval.c (bind_multiple_value_limits):
* event-stream.c:
* event-stream.c (finalize_command_builder):
* events.c:
* events.c (mark_event):
* extents.c:
* extents.c (finalize_extent_info):
* extents.c (uninit_buffer_extents):
* faces.c:
* file-coding.c:
* file-coding.c (finalize_coding_system):
* file-coding.h:
* file-coding.h (struct coding_system_methods):
* file-coding.h (struct detector):
* floatfns.c:
* floatfns.c (extract_float):
* fns.c:
* fns.c (Fidentity):
* font-mgr.c (finalize_fc_pattern):
* font-mgr.c (finalize_fc_config):
* frame.c:
* glyphs.c:
* glyphs.c (finalize_image_instance):
* glyphs.c (unmap_subwindow_instance_cache_mapper):
* gui.c:
* gui.c (gui_error):
* keymap.c:
* lisp.h (struct Lisp_Symbol):
* lrecord.h:
* lrecord.h (struct lrecord_implementation):
* lrecord.h (MC_ALLOC_CALL_FINALIZER):
* lrecord.h (MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE):
* lrecord.h (DEFINE_DUMPABLE_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_SIZABLE_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_SIZABLE_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_SIZABLE_INTERNAL_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_SIZABLE_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_SIZABLE_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_FROB_BLOCK_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_FROB_BLOCK_SIZABLE_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_INTERNAL_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_SIZABLE_INTERNAL_LISP_OBJECT):
* lrecord.h (MAKE_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_MODULE_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_MODULE_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_MODULE_SIZABLE_LISP_OBJECT):
* lrecord.h (DEFINE_DUMPABLE_MODULE_SIZABLE_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_MODULE_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_MODULE_GENERAL_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_MODULE_SIZABLE_LISP_OBJECT):
* lrecord.h (DEFINE_NODUMP_MODULE_SIZABLE_GENERAL_LISP_OBJECT):
* lrecord.h (MAKE_MODULE_LISP_OBJECT):
* lstream.c:
* lstream.c (finalize_lstream):
* lstream.c (disksave_lstream):
* marker.c:
* marker.c (finalize_marker):
* mule-charset.c (make_charset):
* number.c:
* objects.c:
* objects.c (finalize_color_instance):
* objects.c (finalize_font_instance):
* opaque.c:
* opaque.c (make_opaque_ptr):
* process-nt.c:
* process-nt.c (nt_finalize_process_data):
* process-nt.c (nt_deactivate_process):
* process.c:
* process.c (finalize_process):
* procimpl.h (struct process_methods):
* scrollbar.c:
* scrollbar.c (free_scrollbar_instance):
* specifier.c (finalize_specifier):
* symbols.c:
* toolbar.c:
* toolbar.c (Ftoolbar_button_p):
* tooltalk.c:
* ui-gtk.c:
* ui-gtk.c (emacs_gtk_object_finalizer):
* ui-gtk.c (allocate_emacs_gtk_boxed_data):
* window.c:
* window.c (finalize_window):
* window.c (mark_window_as_deleted):
Separate out regular and disksave finalization. Instead of a
FOR_DISKSAVE argument to the finalizer, create a separate object
method `disksaver'. Make `finalizer' have only one argument.
Go through and separate out all finalize methods into finalize
and disksave. Delete lots of thereby redundant disksave checking.
Delete places that signal an error if we attempt to disksave --
all of these objects are non-dumpable and we will get an error
from pdump anyway if we attempt to dump them. After this is done,
only one object remains that has a disksave method -- lstream.
Change DEFINE_*_LISP_OBJECT_WITH_PROPS to DEFINE_*_GENERAL_LISP_OBJECT,
which is used for specifying either property methods or disksave
methods (or in the future, any other less-used methods).
Remove the for_disksave argument to finalize_process_data. Don't
provide a disksaver for processes because no one currently needs
it.
Clean up various places where objects didn't provide a print method.
It was made mandatory in previous changes, and all methods now
either provide their own print method or use internal_object_printer
or external_object_printer.
Change the definition of CONSOLE_LIVE_P to use the contype enum
rather than looking into the conmeths structure -- in some weird
situations with dead objects, the conmeths structure is NULL,
and printing such objects from debug_print() will crash if we try
to look into the conmeths structure.
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Wed, 20 Jan 2010 07:05:57 -0600 |
| parents | d1247f3cc363 |
| children | b5df3737028a |
| rev | line source |
|---|---|
| 428 | 1 /* Stream device functions. |
| 2 Copyright (C) 1995 Free Software Foundation, Inc. | |
| 1279 | 3 Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. |
| 428 | 4 |
| 5 This file is part of XEmacs. | |
| 6 | |
| 7 XEmacs is free software; you can redistribute it and/or modify it | |
| 8 under the terms of the GNU General Public License as published by the | |
| 9 Free Software Foundation; either version 2, or (at your option) any | |
| 10 later version. | |
| 11 | |
| 12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 15 for more details. | |
| 16 | |
| 17 You should have received a copy of the GNU General Public License | |
| 18 along with XEmacs; see the file COPYING. If not, write to | |
| 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 20 Boston, MA 02111-1307, USA. */ | |
| 21 | |
| 22 /* Synched up with: Not in FSF. */ | |
| 23 | |
| 24 /* This file has been Mule-ized. */ | |
| 25 | |
| 26 /* Written by Ben Wing. */ | |
| 27 | |
| 28 #include <config.h> | |
| 29 #include "lisp.h" | |
| 30 | |
| 872 | 31 #include "device-impl.h" |
| 428 | 32 #include "events.h" |
| 872 | 33 #include "frame-impl.h" |
| 428 | 34 #include "redisplay.h" |
| 35 #include "sysdep.h" | |
| 800 | 36 #include "window.h" |
| 37 | |
| 872 | 38 #include "console-stream-impl.h" |
| 800 | 39 #include "console-tty.h" |
| 40 | |
| 428 | 41 #include "sysfile.h" |
| 42 | |
| 43 DEFINE_CONSOLE_TYPE (stream); | |
| 44 | |
| 45 Lisp_Object Vterminal_console; | |
| 46 Lisp_Object Vterminal_device; | |
| 47 Lisp_Object Vterminal_frame; | |
| 48 | |
| 49 Lisp_Object Vstdio_str; | |
| 50 | |
| 1204 | 51 static const struct memory_description stream_console_data_description_1 [] = { |
| 52 { XD_LISP_OBJECT, offsetof (struct stream_console, instream) }, | |
| 53 { XD_END } | |
| 54 }; | |
| 55 | |
| 3092 | 56 #ifdef NEW_GC |
|
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
57 DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("stream-console", stream_console, |
|
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
58 0, stream_console_data_description_1, |
|
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
3263
diff
changeset
|
59 Lisp_Stream_Console); |
| 3092 | 60 #else /* not NEW_GC */ |
| 1204 | 61 const struct sized_memory_description stream_console_data_description = { |
| 62 sizeof (struct stream_console), stream_console_data_description_1 | |
| 63 }; | |
| 3092 | 64 #endif /* not NEW_GC */ |
| 1204 | 65 |
| 428 | 66 static void |
| 2286 | 67 stream_init_console (struct console *con, Lisp_Object UNUSED (params)) |
| 428 | 68 { |
| 69 Lisp_Object tty = CONSOLE_CONNECTION (con); | |
| 70 struct stream_console *stream_con; | |
| 71 | |
| 3092 | 72 #ifdef NEW_GC |
| 73 if (CONSOLE_STREAM_DATA (con) == NULL) | |
|
5120
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
74 CONSOLE_STREAM_DATA (con) = |
|
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
75 XSTREAM_CONSOLE (ALLOC_LISP_OBJECT (stream_console)); |
| 3092 | 76 #else /* not NEW_GC */ |
| 428 | 77 if (CONSOLE_STREAM_DATA (con) == NULL) |
| 1204 | 78 CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console); |
| 3092 | 79 #endif /* not NEW_GC */ |
| 428 | 80 |
| 81 stream_con = CONSOLE_STREAM_DATA (con); | |
| 82 | |
| 1204 | 83 stream_con->instream = Qnil; |
| 428 | 84 |
| 85 /* Open the specified console */ | |
| 86 if (NILP (tty) || internal_equal (tty, Vstdio_str, 0)) | |
| 87 { | |
| 88 stream_con->in = stdin; | |
| 89 stream_con->out = stdout; | |
| 90 stream_con->err = stderr; | |
| 91 } | |
| 92 else | |
| 93 { | |
| 94 CHECK_STRING (tty); | |
| 95 stream_con->in = stream_con->out = stream_con->err = | |
| 442 | 96 /* #### We don't currently do coding-system translation on |
| 97 this descriptor. */ | |
| 771 | 98 qxe_fopen (XSTRING_DATA (tty), READ_PLUS_TEXT); |
| 428 | 99 if (!stream_con->in) |
| 563 | 100 signal_error (Qio_error, "Unable to open tty", tty); |
| 428 | 101 } |
| 102 } | |
| 103 | |
| 104 static void | |
| 2286 | 105 stream_init_device (struct device *d, Lisp_Object UNUSED (params)) |
| 428 | 106 { |
| 107 struct console *con = XCONSOLE (DEVICE_CONSOLE (d)); | |
| 108 | |
| 109 DEVICE_INFD (d) = fileno (CONSOLE_STREAM_DATA (con)->in); | |
| 110 DEVICE_OUTFD (d) = fileno (CONSOLE_STREAM_DATA (con)->out); | |
| 111 init_baud_rate (d); | |
| 112 init_one_device (d); | |
| 113 } | |
| 114 | |
| 115 static int | |
| 2286 | 116 stream_initially_selected_for_input (struct console *UNUSED (con)) |
| 428 | 117 { |
| 118 return noninteractive && initialized; | |
| 119 } | |
| 120 | |
| 121 extern int stdout_needs_newline; | |
| 122 | |
| 123 static void | |
| 124 stream_delete_console (struct console *con) | |
| 125 { | |
| 126 struct stream_console *stream_con = CONSOLE_STREAM_DATA (con); | |
| 127 if (stream_con) | |
| 128 { | |
| 129 if (/* stream_con->needs_newline */ | |
| 130 stdout_needs_newline) /* #### clean this up */ | |
| 131 { | |
| 132 fputc ('\n', stream_con->out); | |
| 133 fflush (stream_con->out); | |
| 134 } | |
| 135 if (stream_con->in != stdin) | |
| 771 | 136 retry_fclose (stream_con->in); |
| 428 | 137 |
| 3263 | 138 #ifndef NEW_GC |
| 1726 | 139 xfree (stream_con, struct stream_console *); |
| 3092 | 140 #endif /* not NEW_GC */ |
| 428 | 141 CONSOLE_STREAM_DATA (con) = NULL; |
| 142 } | |
| 143 } | |
| 144 | |
| 145 Lisp_Object | |
| 146 stream_semi_canonicalize_console_connection (Lisp_Object connection, | |
| 2286 | 147 Error_Behavior UNUSED (errb)) |
| 428 | 148 { |
| 149 return NILP (connection) ? Vstdio_str : connection; | |
| 150 } | |
| 151 | |
| 152 Lisp_Object | |
| 153 stream_canonicalize_console_connection (Lisp_Object connection, | |
| 578 | 154 Error_Behavior errb) |
| 428 | 155 { |
| 156 if (NILP (connection) || internal_equal (connection, Vstdio_str, 0)) | |
| 157 return Vstdio_str; | |
| 158 | |
| 159 if (!ERRB_EQ (errb, ERROR_ME)) | |
| 160 { | |
| 161 if (!STRINGP (connection)) | |
| 162 return Qunbound; | |
| 163 } | |
| 164 else | |
| 165 CHECK_STRING (connection); | |
| 166 | |
| 167 return Ffile_truename (connection, Qnil); | |
| 168 } | |
| 169 | |
| 170 Lisp_Object | |
| 171 stream_semi_canonicalize_device_connection (Lisp_Object connection, | |
| 578 | 172 Error_Behavior errb) |
| 428 | 173 { |
| 174 return stream_semi_canonicalize_console_connection (connection, errb); | |
| 175 } | |
| 176 | |
| 177 Lisp_Object | |
| 178 stream_canonicalize_device_connection (Lisp_Object connection, | |
| 578 | 179 Error_Behavior errb) |
| 428 | 180 { |
| 181 return stream_canonicalize_console_connection (connection, errb); | |
| 182 } | |
| 183 | |
| 184 | |
| 185 static void | |
| 2286 | 186 stream_init_frame_1 (struct frame *f, Lisp_Object UNUSED (props), |
| 771 | 187 int frame_name_is_defaulted) |
| 428 | 188 { |
| 189 #if 0 | |
| 190 struct device *d = XDEVICE (FRAME_DEVICE (f)); | |
| 191 if (!NILP (DEVICE_FRAME_LIST (d))) | |
| 563 | 192 invalid_operation ("Only one frame allowed on stream devices", Qunbound); |
| 428 | 193 #endif |
| 771 | 194 if (frame_name_is_defaulted) |
| 195 f->name = build_string ("stream"); | |
| 428 | 196 f->height = 80; |
| 197 f->width = 24; | |
| 198 f->visible = 0; /* so redisplay doesn't try to do anything */ | |
| 199 } | |
| 200 | |
| 201 | |
| 202 static int | |
| 2286 | 203 stream_text_width (struct frame *UNUSED (f), |
| 204 struct face_cachel *UNUSED (cachel), | |
| 205 const Ichar *UNUSED (str), Charcount len) | |
| 428 | 206 { |
| 207 return len; | |
| 208 } | |
| 209 | |
| 210 static int | |
| 2286 | 211 stream_left_margin_width (struct window *UNUSED (w)) |
| 428 | 212 { |
| 213 return 0; | |
| 214 } | |
| 215 | |
| 216 static int | |
| 2286 | 217 stream_right_margin_width (struct window *UNUSED (w)) |
| 428 | 218 { |
| 219 return 0; | |
| 220 } | |
| 221 | |
| 222 static int | |
| 223 stream_divider_height (void) | |
| 224 { | |
| 225 return 1; | |
| 226 } | |
| 227 | |
| 228 static int | |
| 229 stream_eol_cursor_width (void) | |
| 230 { | |
| 231 return 1; | |
| 232 } | |
| 233 | |
| 1279 | 234 /* We used to try and check for redisplaying on stream devices (e.g. in |
| 235 redisplay_device(), and beg out if so. However, we didn't always manage | |
| 236 completely. Now we do manage completely, and to verify this we abort if | |
| 237 we try to display a stream device. This might fix some crashes I've | |
| 238 been getting in pdump -- the only difference between crash and non-crash | |
| 239 is a few changes to the redisplay critical-section handling. */ | |
| 240 | |
| 241 static void | |
| 2286 | 242 stream_window_output_begin (struct window *UNUSED (w)) |
| 1279 | 243 { |
| 2500 | 244 ABORT (); |
| 1279 | 245 } |
| 246 | |
| 247 static void | |
| 2286 | 248 stream_window_output_end (struct window *UNUSED (w)) |
| 1279 | 249 { |
| 2500 | 250 ABORT (); |
| 1279 | 251 } |
| 252 | |
| 253 static void | |
| 2286 | 254 stream_frame_output_begin (struct frame *UNUSED (f)) |
| 1279 | 255 { |
| 2500 | 256 ABORT (); |
| 1279 | 257 } |
| 258 | |
| 259 static void | |
| 2286 | 260 stream_frame_output_end (struct frame *UNUSED (f)) |
| 1279 | 261 { |
| 2500 | 262 ABORT (); |
| 1279 | 263 } |
| 264 | |
| 428 | 265 static void |
| 2286 | 266 stream_output_display_block (struct window *UNUSED (w), |
| 267 struct display_line *UNUSED (dl), | |
| 268 int UNUSED (block), int UNUSED (start), | |
| 269 int UNUSED (end), int UNUSED (start_pixpos), | |
| 270 int UNUSED (cursor_start), | |
| 271 int UNUSED (cursor_width), | |
| 272 int UNUSED (cursor_height)) | |
| 428 | 273 { |
| 2500 | 274 ABORT (); |
| 428 | 275 } |
| 276 | |
| 277 static void | |
| 2286 | 278 stream_clear_region (Lisp_Object UNUSED (window), struct device* UNUSED (d), |
| 279 struct frame *UNUSED (f), face_index UNUSED (findex), | |
| 280 int UNUSED (x), int UNUSED (y), int UNUSED (width), | |
| 281 int UNUSED (height), Lisp_Object UNUSED (fcolor), | |
| 282 Lisp_Object UNUSED (bcolor), | |
| 283 Lisp_Object UNUSED (background_pixmap)) | |
| 428 | 284 { |
| 2500 | 285 ABORT (); |
| 428 | 286 } |
| 287 | |
| 288 static int | |
| 2286 | 289 stream_flash (struct device *UNUSED (d)) |
| 428 | 290 { |
| 291 return 0; /* sorry can't do it */ | |
| 292 } | |
| 293 | |
| 294 static void | |
| 2286 | 295 stream_ring_bell (struct device *d, int UNUSED (volume), int UNUSED (pitch), |
| 296 int UNUSED (duration)) | |
| 428 | 297 { |
| 298 struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); | |
| 826 | 299 /* Don't output ^G when not a TTY -- in particular, under MS Windows, ^G |
| 300 is interpreted as bell by the console, but not when running under | |
| 301 VC++. Probably this would be the same under Unix. */ | |
| 302 if (isatty (fileno (CONSOLE_STREAM_DATA (c)->out))) | |
| 303 { | |
| 304 fputc (07, CONSOLE_STREAM_DATA (c)->out); | |
| 305 fflush (CONSOLE_STREAM_DATA (c)->out); | |
| 306 } | |
| 428 | 307 } |
| 308 | |
| 309 | |
| 310 /************************************************************************/ | |
| 311 /* initialization */ | |
| 312 /************************************************************************/ | |
| 313 | |
| 314 void | |
| 315 console_type_create_stream (void) | |
| 316 { | |
| 317 INITIALIZE_CONSOLE_TYPE (stream, "stream", "console-stream-p"); | |
| 318 | |
| 319 /* console methods */ | |
| 320 CONSOLE_HAS_METHOD (stream, init_console); | |
| 321 CONSOLE_HAS_METHOD (stream, initially_selected_for_input); | |
| 322 CONSOLE_HAS_METHOD (stream, delete_console); | |
| 323 CONSOLE_HAS_METHOD (stream, canonicalize_console_connection); | |
| 324 CONSOLE_HAS_METHOD (stream, canonicalize_device_connection); | |
| 325 CONSOLE_HAS_METHOD (stream, semi_canonicalize_console_connection); | |
| 326 CONSOLE_HAS_METHOD (stream, semi_canonicalize_device_connection); | |
| 327 | |
| 328 /* device methods */ | |
| 329 CONSOLE_HAS_METHOD (stream, init_device); | |
| 330 | |
| 331 /* frame methods */ | |
| 332 CONSOLE_HAS_METHOD (stream, init_frame_1); | |
| 333 | |
| 334 /* redisplay methods */ | |
| 1279 | 335 CONSOLE_HAS_METHOD (stream, text_width); |
| 428 | 336 CONSOLE_HAS_METHOD (stream, left_margin_width); |
| 337 CONSOLE_HAS_METHOD (stream, right_margin_width); | |
| 338 CONSOLE_HAS_METHOD (stream, divider_height); | |
| 339 CONSOLE_HAS_METHOD (stream, eol_cursor_width); | |
| 1279 | 340 CONSOLE_HAS_METHOD (stream, window_output_begin); |
| 341 CONSOLE_HAS_METHOD (stream, window_output_end); | |
| 342 CONSOLE_HAS_METHOD (stream, frame_output_begin); | |
| 343 CONSOLE_HAS_METHOD (stream, frame_output_end); | |
| 344 CONSOLE_HAS_METHOD (stream, output_display_block); | |
| 428 | 345 CONSOLE_HAS_METHOD (stream, clear_region); |
| 346 CONSOLE_HAS_METHOD (stream, flash); | |
| 347 CONSOLE_HAS_METHOD (stream, ring_bell); | |
| 348 } | |
| 349 | |
| 350 void | |
| 351 reinit_console_type_create_stream (void) | |
| 352 { | |
| 353 REINITIALIZE_CONSOLE_TYPE (stream); | |
| 354 } | |
| 355 | |
| 356 void | |
| 357 vars_of_console_stream (void) | |
| 358 { | |
| 359 DEFVAR_LISP ("terminal-console", &Vterminal_console /* | |
| 444 | 360 The initial console object, which represents XEmacs' stdout. |
| 428 | 361 */ ); |
| 362 Vterminal_console = Qnil; | |
| 363 | |
| 364 DEFVAR_LISP ("terminal-device", &Vterminal_device /* | |
| 444 | 365 The initial device object, which represents XEmacs' stdout. |
| 428 | 366 */ ); |
| 367 Vterminal_device = Qnil; | |
| 368 | |
| 369 DEFVAR_LISP ("terminal-frame", &Vterminal_frame /* | |
| 444 | 370 The initial frame object, which represents XEmacs' stdout. |
| 428 | 371 */ ); |
| 372 Vterminal_frame = Qnil; | |
| 373 | |
| 374 /* Moved from console-tty.c */ | |
| 375 Vstdio_str = build_string ("stdio"); | |
| 376 staticpro (&Vstdio_str); | |
| 377 } | |
| 378 | |
| 379 #ifndef PDUMP | |
| 380 void | |
| 2342 | 381 init_console_stream (int UNUSED (reinit)) |
| 428 | 382 { |
| 383 /* This function can GC */ | |
| 384 if (!initialized) | |
| 385 { | |
| 386 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); | |
| 387 Vterminal_console = Fdevice_console (Vterminal_device); | |
| 388 Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); | |
| 389 minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; | |
| 390 } | |
| 391 else | |
| 392 { | |
| 393 /* Re-initialize the FILE fields of the console. */ | |
| 394 stream_init_console (XCONSOLE (Vterminal_console), Qnil); | |
| 395 if (noninteractive) | |
| 396 event_stream_select_console (XCONSOLE (Vterminal_console)); | |
| 397 } | |
| 398 } | |
| 399 | |
| 400 #else | |
| 401 | |
| 402 void | |
| 442 | 403 init_console_stream (int reinit) |
| 428 | 404 { |
| 405 /* This function can GC */ | |
| 442 | 406 if (!reinit) |
| 407 { | |
| 408 Vterminal_device = Fmake_device (Qstream, Qnil, Qnil); | |
| 409 Vterminal_console = Fdevice_console (Vterminal_device); | |
| 410 Vterminal_frame = Fmake_frame (Qnil, Vterminal_device); | |
| 411 minibuf_window = XFRAME (Vterminal_frame)->minibuffer_window; | |
| 412 } | |
| 428 | 413 if (initialized) |
| 414 { | |
| 415 stream_init_console (XCONSOLE (Vterminal_console), Qnil); | |
| 416 if (noninteractive) | |
| 417 event_stream_select_console (XCONSOLE (Vterminal_console)); | |
| 418 } | |
| 419 } | |
| 420 #endif |
