Mercurial > hg > xemacs-beta
annotate src/console-impl.h @ 2720:6fa9919a9a0b
[xemacs-hg @ 2005-04-08 23:10:01 by crestani]
ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
New configure flag: `MC_ALLOC':
* configure.ac (XE_COMPLEX_ARG_ENABLE): Add `--enable-mc-alloc' as
a new configure flag.
* configure.in (AC_INIT_PARSE_ARGS): Add `--mc-alloc' as a new
configure flag.
* configure.usage: Add description for `mc-alloc'.
DUMP_IN_EXEC:
* Makefile.in.in: Condition the installation of a separate dump
file on !DUMP_ON_EXEC.
* configure.ac (XE_COMPLEX_ARG_ENABLE): Add
`--enable-dump-in-exec' as a new configure flag.
* configure.ac: DUMP_IN_EXEC is define as default for PDUMP but
not default for MC_ALLOC.
* configure.in (AC_INIT_PARSE_ARGS): Add `--dump-in-exec' as a
new configure flag.
* configure.in: DUMP_IN_EXEC is define as default for PDUMP but
not default for MC_ALLOC.
* configure.usage: Add description for `dump-in-exec'.
lib-src/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
DUMP_IN_EXEC:
* Makefile.in.in: Only compile insert-data-in-exec if
DUMP_IN_EXEC is defined.
lisp/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
MEMORY_USAGE_STATS
* diagnose.el: Add new lisp function to pretty print statistics
about the new allocator.
* diagnose.el (show-mc-alloc-memory-usage): New.
modules/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
Remove Lcrecords:
* postgresql/postgresql.c (allocate_pgconn): Allocate with new
allocator.
* postgresql/postgresql.c (allocate_pgresult): Allocate PGresult
with new allocator.
* postgresql/postgresql.h (struct Lisp_PGconn): Add
lrecord_header.
* postgresql/postgresql.h (struct Lisp_PGresult): Add
lrecord_header.
* ldap/eldap.c (allocate_ldap): Allocate with new allocator.
* ldap/eldap.h (struct Lisp_LDAP): Add lrecord_header.
nt/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
New configure flag: `MC_ALLOC':
* config.inc.samp: Add new flag `MC_ALLOC'.
* xemacs.mak: Add flag and configuration output for `MC_ALLOC'.
New files:
* xemacs.dsp: Add source files mc-alloc.c and mc-alloc.h.
* xemacs.mak: Add new object file mc-alloc.obj to dependencies.
src/ChangeLog addition:
2005-04-01 Marcus Crestani <crestani@xemacs.org>
The new allocator.
New configure flag: `MC_ALLOC':
* config.h.in: Add new flag `MC_ALLOC'.
New files:
* Makefile.in.in: Add new object file mc-alloc.o.
* depend: Add new files to dependencies.
* mc-alloc.c: New.
* mc-alloc.h: New.
Running the new allocator from XEmacs:
* alloc.c (deadbeef_memory): Moved to mc-alloc.c.
* emacs.c (main_1): Initialize the new allocator and add
syms_of_mc_alloc.
* symsinit.h: Add syms_of_mc_alloc.
New lrecord allocation and free functions:
* alloc.c (alloc_lrecord): New. Allocates an lrecord, includes
type checking and initializing of the lrecord_header.
* alloc.c (noseeum_alloc_lrecord): Same as above, but increments
the NOSEEUM cons counter.
* alloc.c (free_lrecord): New. Calls the finalizer and frees the
lrecord.
* lrecord.h: Add lrecord allocation prototypes and comments.
Remove old lrecord FROB block allocation:
* alloc.c (allocate_lisp_storage): Former function to expand
heap. Not needed anymore, remove.
* alloc.c: Completely remove `Fixed-size type macros'
* alloc.c (release_breathing_space): Remove.
* alloc.c (memory_full): Remove release_breathing_space.
* alloc.c (refill_memory_reserve): Remove.
* alloc.c (TYPE_ALLOC_SIZE): Remove.
* alloc.c (DECLARE_FIXED_TYPE_ALLOC): Remove.
* alloc.c (ALLOCATE_FIXED_TYPE_FROM_BLOCK): Remove.
* alloc.c (ALLOCATE_FIXED_TYPE_1): Remove.
* alloc.c (ALLOCATE_FIXED_TYPE): Remove.
* alloc.c (NOSEEUM_ALLOCATE_FIXED_TYPE): Remove.
* alloc.c (struct Lisp_Free): Remove.
* alloc.c (LRECORD_FREE_P): Remove.
* alloc.c (MARK_LRECORD_AS_FREE): Remove.
* alloc.c (MARK_LRECORD_AS_NOT_FREE): Remove.
* alloc.c (PUT_FIXED_TYPE_ON_FREE_LIST): Remove.
* alloc.c (FREE_FIXED_TYPE): Remove.
* alloc.c (FREE_FIXED_TYPE_WHEN_NOT_IN_GC): Remove.
Allocate old lrecords with new allocator:
* alloc.c: DECLARE_FIXED_TYPE_ALLOC removed for all lrecords
defined in alloc.c.
* alloc.c (Fcons): Allocate with new allocator.
* alloc.c (noseeum_cons): Allocate with new allocator.
* alloc.c (make_float): Allocate with new allocator.
* alloc.c (make_bignum): Allocate with new allocator.
* alloc.c (make_bignum_bg): Allocate with new allocator.
* alloc.c (make_ratio): Allocate with new allocator.
* alloc.c (make_ratio_bg): Allocate with new allocator.
* alloc.c (make_ratio_rt): Allocate with new allocator.
* alloc.c (make_bigfloat): Allocate with new allocator.
* alloc.c (make_bigfloat_bf): Allocate with new allocator.
* alloc.c (make_compiled_function): Allocate with new allocator.
* alloc.c (Fmake_symbol): Allocate with new allocator.
* alloc.c (allocate_extent): Allocate with new allocator.
* alloc.c (allocate_event): Allocate with new allocator.
* alloc.c (make_key_data): Allocate with new allocator.
* alloc.c (make_button_data): Allocate with new allocator.
* alloc.c (make_motion_data): Allocate with new allocator.
* alloc.c (make_process_data): Allocate with new allocator.
* alloc.c (make_timeout_data): Allocate with new allocator.
* alloc.c (make_magic_data): Allocate with new allocator.
* alloc.c (make_magic_eval_data): Allocate with new allocator.
* alloc.c (make_eval_data): Allocate with new allocator.
* alloc.c (make_misc_user_data): Allocate with new allocator.
* alloc.c (Fmake_marker): Allocate with new allocator.
* alloc.c (noseeum_make_marker): Allocate with new allocator.
* alloc.c (make_uninit_string): Allocate with new allocator.
* alloc.c (resize_string): Allocate with new allocator.
* alloc.c (make_string_nocopy): Allocate with new allocator.
Garbage Collection:
* alloc.c (GC_CHECK_NOT_FREE): Remove obsolete assertions.
* alloc.c (SWEEP_FIXED_TYPE_BLOCK): Remove.
* alloc.c (SWEEP_FIXED_TYPE_BLOCK_1): Remove.
* alloc.c (sweep_conses): Remove.
* alloc.c (free_cons): Use new allocator to free.
* alloc.c (sweep_compiled_functions): Remove.
* alloc.c (sweep_floats): Remove.
* alloc.c (sweep_bignums): Remove.
* alloc.c (sweep_ratios): Remove.
* alloc.c (sweep_bigfloats): Remove.
* alloc.c (sweep_symbols): Remove.
* alloc.c (sweep_extents): Remove.
* alloc.c (sweep_events): Remove.
* alloc.c (sweep_key_data): Remove.
* alloc.c (free_key_data): Use new allocator to free.
* alloc.c (sweep_button_data): Remove.
* alloc.c (free_button_data): Use new allocator to free.
* alloc.c (sweep_motion_data): Remove.
* alloc.c (free_motion_data): Use new allocator to free.
* alloc.c (sweep_process_data): Remove.
* alloc.c (free_process_data): Use new allocator to free.
* alloc.c (sweep_timeout_data): Remove.
* alloc.c (free_timeout_data): Use new allocator to free.
* alloc.c (sweep_magic_data): Remove.
* alloc.c (free_magic_data): Use new allocator to free.
* alloc.c (sweep_magic_eval_data): Remove.
* alloc.c (free_magic_eval_data): Use new allocator to free.
* alloc.c (sweep_eval_data): Remove.
* alloc.c (free_eval_data): Use new allocator to free.
* alloc.c (sweep_misc_user_data): Remove.
* alloc.c (free_misc_user_data): Use new allocator to free.
* alloc.c (sweep_markers): Remove.
* alloc.c (free_marker): Use new allocator to free.
* alloc.c (garbage_collect_1): Remove release_breathing_space.
* alloc.c (gc_sweep): Remove all the old lcrecord and lrecord
related stuff. Sweeping now works like this: compact string
chars, finalize, sweep.
* alloc.c (common_init_alloc_early): Remove old lrecord
initializations, remove breathing_space.
* emacs.c (Fdump_emacs): Remove release_breathing_space.
* lisp.h: Remove prototype for release_breathing_space.
* lisp.h: Adjust the special cons mark makros.
Lrecord Finalizer:
* alloc.c: Add finalizer to lrecord definition.
* alloc.c (finalize_string): Add finalizer for string.
* bytecode.c: Add finalizer to lrecord definition.
* bytecode.c (finalize_compiled_function): Add finalizer for
compiled function.
* marker.c: Add finalizer to lrecord definition.
* marker.c (finalize_marker): Add finalizer for marker.
These changes build the interface to mc-alloc:
* lrecord.h (MC_ALLOC_CALL_FINALIZER): Tell mc-alloc how to
finalize lrecords.
* lrecord.h (MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE): Tell
mc-alloc how to finalize for disksave.
Unify lrecords and lcrecords:
* lisp.h (struct Lisp_String): Adjust string union hack to
new lrecord header.
* lrecord.h: Adjust comments.
* lrecord.h (struct lrecord_header): The new lrecord header
includes type, lisp-readonly, free, and uid.
* lrecord.h (set_lheader_implementation): Adjust to new
lrecord_header.
* lrecord.h (struct lrecord_implementation): The field basic_p
for indication of an old lrecord is not needed anymore, remove.
* lrecord.h (MAKE_LRECORD_IMPLEMENTATION): Remove basic_p.
* lrecord.h (MAKE_EXTERNAL_LRECORD_IMPLEMENTATION): Remove
basic_p.
* lrecord.h (copy_sized_lrecord): Remove distinction between
old lrecords and lcrecords.
* lrecord.h (copy_lrecord): Remove distinction between old
lrecords and lcrecords.
* lrecord.h (zero_sized_lrecord): Remove distinction between
old lrecords and lcrecords.
* lrecord.h (zero_lrecord): Remove distinction between old
lrecords and lcrecords.
Remove lcrecords and lcrecord lists:
* alloc.c (basic_alloc_lcrecord): Not needed anymore, remove.
* alloc.c (very_old_free_lcrecord): Not needed anymore, remove.
* alloc.c (copy_lisp_object): No more distinction between
lrecords and lcrecords.
* alloc.c (all_lcrecords): Not needed anymore, remove.
* alloc.c (make_vector_internal): Allocate as lrecord.
* alloc.c (make_bit_vector_internal): Allocate as lrecord.
* alloc.c: Completely remove `lcrecord lists'.
* alloc.c (free_description): Remove.
* alloc.c (lcrecord_list_description): Remove.
* alloc.c (mark_lcrecord_list): Remove.
* alloc.c (make_lcrecord_list): Remove.
* alloc.c (alloc_managed_lcrecord): Remove.
* alloc.c (free_managed_lcrecord): Remove.
* alloc.c (alloc_automanaged_lcrecord): Remove.
* alloc.c (free_lcrecord): Remove.
* alloc.c (lcrecord_stats): Remove.
* alloc.c (tick_lcrecord_stats): Remove.
* alloc.c (disksave_object_finalization_1): Add call to
mc_finalize_for_disksave. Remove the lcrecord way to visit all
objects.
* alloc.c (kkcc_marking): Remove XD_FLAG_FREE_LISP_OBJECT
* alloc.c (sweep_lcrecords_1): Remove.
* alloc.c (common_init_alloc_early): Remove everything related
to lcrecords, remove old lrecord initializations,
* alloc.c (init_lcrecord_lists): Not needed anymore, remove.
* alloc.c (reinit_alloc_early): Remove everything related to
lcrecords.
* alloc.c (init_alloc_once_early): Remove everything related to
lcrecords.
* buffer.c (allocate_buffer): Allocate as lrecord.
* buffer.c (nuke_all_buffer_slots): Use lrecord functions.
* buffer.c (common_init_complex_vars_of_buffer): Allocate as
lrecord.
* buffer.h (struct buffer): Add lrecord_header.
* casetab.c (allocate_case_table): Allocate as lrecord.
* casetab.h (struct Lisp_Case_Table): Add lrecord_header.
* charset.h (struct Lisp_Charset): Add lrecord_header.
* chartab.c (fill_char_table): Use lrecord functions.
* chartab.c (Fmake_char_table): Allocate as lrecord.
* chartab.c (make_char_table_entry): Allocate as lrecord.
* chartab.c (copy_char_table_entry): Allocate as lrecord.
* chartab.c (Fcopy_char_table): Allocate as lrecord.
* chartab.c (put_char_table): Use lrecord functions.
* chartab.h (struct Lisp_Char_Table_Entry): Add lrecord_header.
* chartab.h (struct Lisp_Char_Table): Add lrecord_header.
* console-impl.h (struct console): Add lrecord_header.
* console-msw-impl.h (struct Lisp_Devmode): Add lrecord_header.
* console-msw-impl.h (struct mswindows_dialog_id): Add
lrecord_header.
* console.c (allocate_console): Allocate as lrecord.
* console.c (nuke_all_console_slots): Use lrecord functions.
* console.c (common_init_complex_vars_of_console): Allocate as
lrecord.
* data.c (make_weak_list): Allocate as lrecord.
* data.c (make_weak_box): Allocate as lrecord.
* data.c (make_ephemeron): Allocate as lrecord.
* database.c (struct Lisp_Database): Add lrecord_header.
* database.c (allocate_database): Allocate as lrecord.
* device-impl.h (struct device): Add lrecord_header.
* device-msw.c (allocate_devmode): Allocate as lrecord.
* device.c (nuke_all_device_slots): Use lrecord functions.
* device.c (allocate_device): Allocate as lrecord.
* dialog-msw.c (handle_question_dialog_box): Allocate as lrecord.
* elhash.c (struct Lisp_Hash_Table): Add lrecord_header.
* elhash.c (make_general_lisp_hash_table): Allocate as lrecord.
* elhash.c (Fcopy_hash_table): Allocate as lrecord.
* event-stream.c: Lcrecord lists Vcommand_builder_free_list and
Vtimeout_free_list are no longer needed. Remove.
* event-stream.c (allocate_command_builder): Allocate as lrecord.
* event-stream.c (free_command_builder): Use lrecord functions.
* event-stream.c (event_stream_generate_wakeup): Allocate as
lrecord.
* event-stream.c (event_stream_resignal_wakeup): Use lrecord
functions.
* event-stream.c (event_stream_disable_wakeup): Use lrecord
functions.
* event-stream.c (reinit_vars_of_event_stream): Lcrecord lists
remove.
* events.h (struct Lisp_Timeout): Add lrecord_header.
* events.h (struct command_builder): Add lrecord_header.
* extents-impl.h (struct extent_auxiliary): Add lrecord_header.
* extents-impl.h (struct extent_info): Add lrecord_header.
* extents.c (allocate_extent_auxiliary): Allocate as lrecord.
* extents.c (allocate_extent_info): Allocate as lrecord.
* extents.c (copy_extent): Allocate as lrecord.
* faces.c (allocate_face): Allocate as lrecord.
* faces.h (struct Lisp_Face): Add lrecord_header.
* file-coding.c (allocate_coding_system): Allocate as lrecord.
* file-coding.c (Fcopy_coding_system): Allocate as lrecord.
* file-coding.h (struct Lisp_Coding_System): Add lrecord_header.
* fns.c (Ffillarray): Allocate as lrecord.
* frame-impl.h (struct frame): Add lrecord_header.
* frame.c (nuke_all_frame_slots): Use lrecord functions.
* frame.c (allocate_frame_core): Allocate as lrecord.
* glyphs.c (allocate_image_instance): Allocate as lrecord.
* glyphs.c (Fcolorize_image_instance): Allocate as lrecord.
* glyphs.c (allocate_glyph): Allocate as lrecord.
* glyphs.h (struct Lisp_Image_Instance): Add lrecord_header.
* glyphs.h (struct Lisp_Glyph): Add lrecord_header.
* gui.c (allocate_gui_item): Allocate as lrecord.
* gui.h (struct Lisp_Gui_Item): Add lrecord_header.
* keymap.c (struct Lisp_Keymap): Add lrecord_header.
* keymap.c (make_keymap): Allocate as lrecord.
* lisp.h (struct Lisp_Vector): Add lrecord_header.
* lisp.h (struct Lisp_Bit_Vector): Add lrecord_header.
* lisp.h (struct weak_box): Add lrecord_header.
* lisp.h (struct ephemeron): Add lrecord_header.
* lisp.h (struct weak_list): Add lrecord_header.
* lrecord.h (struct lcrecord_header): Not used, remove.
* lrecord.h (struct free_lcrecord_header): Not used, remove.
* lrecord.h (struct lcrecord_list): Not needed anymore, remove.
* lrecord.h (lcrecord_list): Not needed anymore, remove.
* lrecord.h: (enum data_description_entry_flags): Remove
XD_FLAG_FREE_LISP_OBJECT.
* lstream.c: Lrecord list Vlstream_free_list remove.
* lstream.c (Lstream_new): Allocate as lrecord.
* lstream.c (Lstream_delete): Use lrecod functions.
* lstream.c (reinit_vars_of_lstream): Vlstream_free_list
initialization remove.
* lstream.h (struct lstream): Add lrecord_header.
* emacs.c (main_1): Remove lstream initialization.
* mule-charset.c (make_charset): Allocate as lrecord.
* objects-impl.h (struct Lisp_Color_Instance): Add
lrecord_header.
* objects-impl.h (struct Lisp_Font_Instance): Add lrecord_header.
* objects.c (Fmake_color_instance): Allocate as lrecord.
* objects.c (Fmake_font_instance): Allocate as lrecord.
* objects.c (reinit_vars_of_objects): Allocate as lrecord.
* opaque.c: Lcreord list Vopaque_ptr_list remove.
* opaque.c (make_opaque): Allocate as lrecord.
* opaque.c (make_opaque_ptr): Allocate as lrecord.
* opaque.c (free_opaque_ptr): Use lrecord functions.
* opaque.c (reinit_opaque_early):
* opaque.c (init_opaque_once_early): Vopaque_ptr_list
initialization remove.
* opaque.h (Lisp_Opaque): Add lrecord_header.
* opaque.h (Lisp_Opaque_Ptr): Add lrecord_header.
* emacs.c (main_1): Remove opaque variable initialization.
* print.c (default_object_printer): Use new lrecord_header.
* print.c (print_internal): Use new lrecord_header.
* print.c (debug_p4): Use new lrecord_header.
* process.c (make_process_internal): Allocate as lrecord.
* procimpl.h (struct Lisp_Process): Add lrecord_header.
* rangetab.c (Fmake_range_table): Allocate as lrecord.
* rangetab.c (Fcopy_range_table): Allocate as lrecord.
* rangetab.h (struct Lisp_Range_Table): Add lrecord_header.
* scrollbar.c (create_scrollbar_instance): Allocate as lrecord.
* scrollbar.h (struct scrollbar_instance): Add lrecord_header.
* specifier.c (make_specifier_internal): Allocate as lrecord.
* specifier.h (struct Lisp_Specifier): Add lrecord_header.
* symbols.c:
* symbols.c (Fmake_variable_buffer_local): Allocate as lrecord.
* symbols.c (Fdontusethis_set_symbol_value_handler): Allocate
as lrecord.
* symbols.c (Fdefvaralias): Allocate as lrecord.
* symeval.h (struct symbol_value_magic): Add lrecord_header.
* toolbar.c (update_toolbar_button): Allocate as lrecord.
* toolbar.h (struct toolbar_button): Add lrecord_header.
* tooltalk.c (struct Lisp_Tooltalk_Message): Add lrecord_header.
* tooltalk.c (make_tooltalk_message): Allocate as lrecord.
* tooltalk.c (struct Lisp_Tooltalk_Pattern): Add lrecord_header.
* tooltalk.c (make_tooltalk_pattern): Allocate as lrecord.
* ui-gtk.c (allocate_ffi_data): Allocate as lrecord.
* ui-gtk.c (allocate_emacs_gtk_object_data): Allocate as lrecord.
* ui-gtk.c (allocate_emacs_gtk_boxed_data): Allocate as lrecord.
* ui-gtk.h (structs): Add lrecord_header.
* window-impl.h (struct window): Add lrecord_header.
* window-impl.h (struct window_mirror): Add lrecord_header.
* window.c (allocate_window): Allocate as lrecord.
* window.c (new_window_mirror): Allocate as lrecord.
* window.c (make_dummy_parent): Allocate as lrecord.
MEMORY_USAGE_STATS
* alloc.c (fixed_type_block_overhead): Not used anymore, remove.
* buffer.c (compute_buffer_usage): Get storage size from new
allocator.
* marker.c (compute_buffer_marker_usage): Get storage size from
new allocator.
* mule-charset.c (compute_charset_usage): Get storage size from
new allocator.
* scrollbar-gtk.c (gtk_compute_scrollbar_instance_usage): Get
storage size from new allocator.
* scrollbar-msw.c (mswindows_compute_scrollbar_instance_usage):
Get storage size from new allocator.
* scrollbar-x.c (x_compute_scrollbar_instance_usage): Get
storage size from new allocator.
* scrollbar.c (compute_scrollbar_instance_usage): Get storage
size from new allocator.
* unicode.c (compute_from_unicode_table_size_1): Get storage
size from new allocator.
* unicode.c (compute_to_unicode_table_size_1): Get storage size
from new allocator.
* window.c (compute_window_mirror_usage): Get storage size from
new allocator.
* window.c (compute_window_usage): Get storage size from new
allocator.
MC_ALLOC_TYPE_STATS:
* alloc.c (alloc_lrecord): Bump lrecord count.
* alloc.c (noseeum_alloc_lrecord): Bump lrecord count.
* alloc.c (struct lrecord_stats): Storage for counts.
* alloc.c (init_lrecord_stats): Zero statistics.
* alloc.c (inc_lrecord_stats): Increase the statistic.
* alloc.c (dec_lrecord_stats): Decrease the statistic.
* alloc.c (gc_plist_hack): Used to print the information.
* alloc.c (Fgarbage_collect): Return the collected information.
* mc-alloc.c (remove_cell): Decrease lrecord count.
* mc-alloc.h: Set flag MC_ALLOC_TYPE_STATS.
* emacs.c (main_1): Init lrecord statistics.
* lrecord.h: Add prototypes for *_lrecord_stats.
Strings:
* alloc.c (Fmake_string): Initialize ascii_begin to zero.
* alloc.c (gc_count_num_short_string_in_use): Remove.
* alloc.c (gc_count_string_total_size): Remove.
* alloc.c (gc_count_short_string_total_size): Remove.
* alloc.c (debug_string_purity): Remove.
* alloc.c (debug_string_purity_print): Remove.
* alloc.c (sweep_strings): Remove.
Remove static C-readonly Lisp objects:
* alloc.c (c_readonly): Not needed anymore, remove.
* alloc.c (GC_CHECK_LHEADER_INVARIANTS): Remove some obsolete
lheader invariants assertions.
* buffer.c (DEFVAR_BUFFER_LOCAL_1): Allocate dynamically.
* console.c (DEFVAR_CONSOLE_LOCAL_1): Allocate dynamically.
* gpmevent.c: Indirection via MC_ALLOC_Freceive_gpm_event.
* gpmevent.c (Fgpm_enable): Allocate dynamically.
* gpmevent.c (syms_of_gpmevent): Allocate dynamically.
* lisp.h (C_READONLY): Not needed anymore, remove.
* lisp.h (DEFUN): Allocate dynamically.
* lrecord.h (C_READONLY_RECORD_HEADER_P): Not needed anymore,
remove.
* lrecord.h (SET_C_READONLY_RECORD_HEADER): Not needed anymore,
remove.
* symbols.c (guts_of_unbound_marker):
* symeval.h (defsubr): Allocate dynamically.
* symeval.h (DEFSUBR_MACRO): Allocate dynamically.
* symeval.h (DEFVAR_ SYMVAL_FWD): Allocate dynamically.
* tests.c (TESTS_DEFSUBR): Allocate dynamically.
Definition of mcpro:
* lisp.h: Add mcpro prototypes.
* alloc.c (common_init_alloc_early): Add initialization for
mcpros.
* alloc.c (mcpro_description_1): New.
* alloc.c (mcpro_description): New.
* alloc.c (mcpros_description_1): New.
* alloc.c (mcpros_description): New.
* alloc.c (mcpro_one_name_description_1): New.
* alloc.c (mcpro_one_name_description): New.
* alloc.c (mcpro_names_description_1): New.
* alloc.c (mcpro_names_description): New.
* alloc.c (mcpros): New.
* alloc.c (mcpro_names): New.
* alloc.c (mcpro_1): New.
* alloc.c (mc_pro): New.
* alloc.c (garbage_collect_1): Add mcpros to root set.
Usage of mcpro:
* alloc.c (make_string_nocopy): Add string to root set.
* symbols.c (init_symbols_once_early): Add Qunbound to root set.
Changes to the Portable Dumper:
* alloc.c (FREE_OR_REALLOC_BEGIN): Since dumped objects can be
freed with the new allocator, remove assertion for !DUMPEDP.
* dumper.c: Adjust comments, increase PDUMP_HASHSIZE.
* dumper.c (pdump_make_hash): Shift address only 2 bytes, to
avoid collisions.
* dumper.c (pdump_objects_unmark): No more mark bits within
the object, remove.
* dumper.c (mc_addr_elt): New. Element data structure for mc
hash table.
* dumper.c (pdump_mc_hash): New hash table: `lookup table'.
* dumper.c (pdump_get_mc_addr): New. Lookup for hash table.
* dumper.c (pdump_get_indirect_mc_addr): New. Lookup for
convertibles.
* dumper.c (pdump_put_mc_addr): New. Putter for hash table.
* dumper.c (pdump_dump_mc_data): New. Writes the table for
relocation at load time to the dump file.
* dumper.c (pdump_scan_lisp_objects_by_alignment): New.
Visits all dumped Lisp objects.
* dumper.c (pdump_scan_non_lisp_objects_by_alignment): New.
Visits all other dumped objects.
* dumper.c (pdump_reloc_one_mc): New. Updates all pointers
of an object by using the hash table pdump_mc_hash.
* dumper.c (pdump_reloc_one): Replaced by pdump_reloc_one_mc.
* dumper.c (pdump): Change the structure of the dump file, add
the mc post dump relocation table to dump file.
* dumper.c (pdump_load_finish): Hand all dumped objects to the
new allocator and use the mc post dump relocation table for
relocating the dumped objects at dump file load time, free not
longer used data structures.
* dumper.c (pdump_load): Free the dump file.
* dumper.h: Remove pdump_objects_unmark.
* lrecord.h (DUMPEDP): Dumped objects can be freed, remove.
DUMP_IN_EXEC:
* Makefile.in.in: Linking for and with dump in executable only if
DUMP_IN_EXEC is defined.
* config.h.in: Add new flag `DUMP_IN_EXEC'
* emacs.c: Condition dump-data.h on DUMP_IN_EXEC.
* emacs.c (main_1): Flag `-si' only works if dump image is
written into executable.
Miscellanious
* lrecord.h (enum lrecord_type): Added numbers to all types,
very handy for debugging.
* xemacs.def.in.in: Add mc-alloc functions to make them visible
to the modules.
author | crestani |
---|---|
date | Fri, 08 Apr 2005 23:11:35 +0000 |
parents | 491f8cf78a9c |
children | a25c824ed558 |
rev | line source |
---|---|
872 | 1 /* Define console object for XEmacs. |
1318 | 2 Copyright (C) 1996, 2002, 2003 Ben Wing |
872 | 3 |
4 This file is part of XEmacs. | |
5 | |
6 XEmacs is free software; you can redistribute it and/or modify it | |
7 under the terms of the GNU General Public License as published by the | |
8 Free Software Foundation; either version 2, or (at your option) any | |
9 later version. | |
10 | |
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with XEmacs; see the file COPYING. If not, write to | |
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
19 Boston, MA 02111-1307, USA. */ | |
20 | |
21 /* Synched up with: Not in FSF. */ | |
22 | |
23 /* Written by Ben Wing. */ | |
24 | |
25 #ifndef INCLUDED_console_impl_h_ | |
26 #define INCLUDED_console_impl_h_ | |
27 | |
28 #include "console.h" | |
29 | |
1204 | 30 extern const struct sized_memory_description cted_description; |
31 extern const struct sized_memory_description console_methods_description; | |
872 | 32 |
33 | |
34 /* | |
35 * Constants returned by device_implementation_flags_method | |
36 */ | |
37 | |
38 /* Set when device uses pixel-based geometry */ | |
39 #define XDEVIMPF_PIXEL_GEOMETRY 0x00000001L | |
40 | |
41 /* Indicates that the device is a printer */ | |
42 #define XDEVIMPF_IS_A_PRINTER 0x00000002L | |
43 | |
44 /* Do not automatically redisplay this device */ | |
45 #define XDEVIMPF_NO_AUTO_REDISPLAY 0x00000004L | |
46 | |
47 /* Do not delete the device when last frame's gone */ | |
48 #define XDEVIMPF_FRAMELESS_OK 0x00000008L | |
49 | |
50 /* Do not preempt resiaply of frame or device once it starts */ | |
51 #define XDEVIMPF_DONT_PREEMPT_REDISPLAY 0x00000010L | |
52 | |
53 struct console_methods | |
54 { | |
55 const char *name; /* Used by print_console, print_device, print_frame */ | |
56 Lisp_Object symbol; | |
57 Lisp_Object predicate_symbol; | |
58 unsigned int flags; /* Read-only implementation flags, set once upon | |
59 console type creation. INITIALIZE_CONSOLE_TYPE sets | |
60 this member to 0. */ | |
61 | |
62 /* console methods */ | |
63 void (*init_console_method) (struct console *, Lisp_Object props); | |
64 void (*mark_console_method) (struct console *); | |
65 int (*initially_selected_for_input_method) (struct console *); | |
66 void (*delete_console_method) (struct console *); | |
67 Lisp_Object (*semi_canonicalize_console_connection_method) | |
68 (Lisp_Object connection, Error_Behavior errb); | |
69 Lisp_Object (*semi_canonicalize_device_connection_method) | |
70 (Lisp_Object connection, Error_Behavior errb); | |
71 Lisp_Object (*canonicalize_console_connection_method) | |
72 (Lisp_Object connection, Error_Behavior errb); | |
73 Lisp_Object (*canonicalize_device_connection_method) | |
74 (Lisp_Object connection, Error_Behavior errb); | |
75 Lisp_Object (*device_to_console_connection_method) | |
76 (Lisp_Object connection, Error_Behavior errb); | |
77 | |
78 /* device methods */ | |
79 void (*init_device_method) (struct device *, Lisp_Object props); | |
80 void (*finish_init_device_method) (struct device *, Lisp_Object props); | |
81 void (*delete_device_method) (struct device *); | |
82 void (*mark_device_method) (struct device *); | |
83 void (*asynch_device_change_method) (void); | |
84 Lisp_Object (*device_system_metrics_method) (struct device *, | |
85 enum device_metrics); | |
86 Lisp_Object (*own_selection_method)(Lisp_Object selection_name, | |
87 Lisp_Object selection_value, | |
88 Lisp_Object how_to_add, | |
89 Lisp_Object selection_type, | |
90 int owned_p); | |
91 void (*disown_selection_method)(Lisp_Object selection_name, | |
92 Lisp_Object timeval); | |
93 Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol, | |
94 Lisp_Object target_type); | |
95 Lisp_Object (*selection_exists_p_method)(Lisp_Object selection_name, | |
96 Lisp_Object selection_type); | |
97 Lisp_Object (*available_selection_types_method)(Lisp_Object selection_name); | |
98 Lisp_Object (*register_selection_data_type_method)(Lisp_Object type_name); | |
99 Lisp_Object (*selection_data_type_name_method)(Lisp_Object type); | |
100 | |
101 /* frame methods */ | |
102 Lisp_Object *device_specific_frame_props; | |
103 void (*init_frame_1_method) (struct frame *, Lisp_Object properties, | |
104 int frame_name_is_defaulted); | |
105 void (*init_frame_2_method) (struct frame *, Lisp_Object properties); | |
106 void (*init_frame_3_method) (struct frame *); | |
107 void (*after_init_frame_method) (struct frame *, int first_on_device, | |
108 int first_on_console); | |
109 void (*mark_frame_method) (struct frame *); | |
110 void (*delete_frame_method) (struct frame *); | |
111 void (*focus_on_frame_method) (struct frame *); | |
112 void (*raise_frame_method) (struct frame *); | |
113 void (*lower_frame_method) (struct frame *); | |
114 void (*enable_frame_method) (struct frame *); | |
115 void (*disable_frame_method) (struct frame *); | |
116 int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame, | |
117 int *x, int *y); | |
118 void (*set_mouse_position_method) (struct window *w, int x, int y); | |
119 void (*make_frame_visible_method) (struct frame *f); | |
120 void (*make_frame_invisible_method) (struct frame *f); | |
121 void (*iconify_frame_method) (struct frame *f); | |
122 Lisp_Object (*frame_property_method) (struct frame *f, Lisp_Object prop); | |
123 int (*internal_frame_property_p_method) (struct frame *f, | |
124 Lisp_Object prop); | |
125 Lisp_Object (*frame_properties_method) (struct frame *f); | |
126 void (*set_frame_properties_method) (struct frame *f, Lisp_Object plist); | |
127 void (*set_frame_size_method) (struct frame *f, int width, int height); | |
128 void (*set_frame_position_method) (struct frame *f, int xoff, int yoff); | |
129 int (*frame_visible_p_method) (struct frame *f); | |
130 int (*frame_totally_visible_p_method) (struct frame *f); | |
131 int (*frame_iconified_p_method) (struct frame *f); | |
132 void (*set_title_from_ibyte_method) (struct frame *f, Ibyte *title); | |
133 void (*set_icon_name_from_ibyte_method) (struct frame *f, Ibyte *title); | |
134 void (*set_frame_pointer_method) (struct frame *f); | |
135 void (*set_frame_icon_method) (struct frame *f); | |
136 void (*popup_menu_method) (Lisp_Object menu, Lisp_Object event); | |
137 Lisp_Object (*get_frame_parent_method) (struct frame *f); | |
138 void (*update_frame_external_traits_method) (struct frame *f, Lisp_Object name); | |
139 int (*frame_size_fixed_p_method) (struct frame *f); | |
140 void (*eject_page_method) (struct frame *f); | |
141 | |
142 /* redisplay methods */ | |
143 int (*left_margin_width_method) (struct window *); | |
144 int (*right_margin_width_method) (struct window *); | |
145 int (*text_width_method) (struct frame *f, struct face_cachel *cachel, | |
146 const Ichar *str, Charcount len); | |
147 void (*output_display_block_method) (struct window *, struct display_line *, | |
148 int, int, int, int, int, int, int); | |
149 int (*divider_height_method) (void); | |
150 int (*eol_cursor_width_method) (void); | |
151 void (*output_vertical_divider_method) (struct window *, int); | |
152 void (*clear_to_window_end_method) (struct window *, int, int); | |
153 void (*clear_region_method) (Lisp_Object, struct device*, struct frame*, face_index, | |
154 int, int, int, int, | |
155 Lisp_Object, Lisp_Object, Lisp_Object); | |
156 void (*clear_frame_method) (struct frame *); | |
157 void (*window_output_begin_method) (struct window *); | |
158 void (*frame_output_begin_method) (struct frame *); | |
159 void (*window_output_end_method) (struct window *); | |
160 void (*frame_output_end_method) (struct frame *); | |
161 int (*flash_method) (struct device *); | |
162 void (*ring_bell_method) (struct device *, int volume, int pitch, | |
163 int duration); | |
164 void (*frame_redraw_cursor_method) (struct frame *f); | |
165 void (*set_final_cursor_coords_method) (struct frame *, int, int); | |
166 void (*bevel_area_method) (struct window *, face_index, int, int, int, int, int, | |
167 int, enum edge_style); | |
168 void (*output_pixmap_method) (struct window *w, Lisp_Object image_instance, | |
169 struct display_box *db, struct display_glyph_area *dga, | |
170 face_index findex, int cursor_start, int cursor_width, | |
171 int cursor_height, int offset_bitmap); | |
172 void (*output_string_method) (struct window *w, struct display_line *dl, | |
173 Ichar_dynarr *buf, int xpos, int xoffset, | |
174 int start_pixpos, int width, face_index findex, | |
175 int cursor, int cursor_start, int cursor_width, | |
176 int cursor_height); | |
177 | |
178 /* color methods */ | |
179 int (*initialize_color_instance_method) (Lisp_Color_Instance *, | |
180 Lisp_Object name, | |
181 Lisp_Object device, | |
182 Error_Behavior errb); | |
183 void (*mark_color_instance_method) (Lisp_Color_Instance *); | |
184 void (*print_color_instance_method) (Lisp_Color_Instance *, | |
185 Lisp_Object printcharfun, | |
186 int escapeflag); | |
187 void (*finalize_color_instance_method) (Lisp_Color_Instance *); | |
188 int (*color_instance_equal_method) (Lisp_Color_Instance *, | |
189 Lisp_Color_Instance *, | |
190 int depth); | |
191 Hashcode (*color_instance_hash_method) (Lisp_Color_Instance *, | |
192 int depth); | |
193 Lisp_Object (*color_instance_rgb_components_method) (Lisp_Color_Instance *); | |
194 int (*valid_color_name_p_method) (struct device *, Lisp_Object color); | |
2527 | 195 Lisp_Object (*color_list_method) (void); |
872 | 196 |
197 /* font methods */ | |
198 int (*initialize_font_instance_method) (Lisp_Font_Instance *, | |
199 Lisp_Object name, | |
200 Lisp_Object device, | |
201 Error_Behavior errb); | |
202 void (*mark_font_instance_method) (Lisp_Font_Instance *); | |
203 void (*print_font_instance_method) (Lisp_Font_Instance *, | |
204 Lisp_Object printcharfun, | |
205 int escapeflag); | |
206 void (*finalize_font_instance_method) (Lisp_Font_Instance *); | |
207 Lisp_Object (*font_instance_truename_method) (Lisp_Font_Instance *, | |
208 Error_Behavior errb); | |
209 Lisp_Object (*font_instance_properties_method) (Lisp_Font_Instance *); | |
2527 | 210 Lisp_Object (*font_list_method) (Lisp_Object pattern, |
1701 | 211 Lisp_Object device, |
212 Lisp_Object maxnumber); | |
872 | 213 Lisp_Object (*find_charset_font_method) (Lisp_Object device, |
214 Lisp_Object font, | |
215 Lisp_Object charset, | |
216 int stage); | |
217 int (*font_spec_matches_charset_method) (struct device *d, | |
218 Lisp_Object charset, | |
219 const Ibyte *nonreloc, | |
220 Lisp_Object reloc, | |
221 Bytecount offset, | |
222 Bytecount length, | |
223 int stage); | |
224 | |
225 /* image methods */ | |
226 void (*mark_image_instance_method) (Lisp_Image_Instance *); | |
227 void (*print_image_instance_method) (Lisp_Image_Instance *, | |
228 Lisp_Object printcharfun, | |
229 int escapeflag); | |
230 void (*finalize_image_instance_method) (Lisp_Image_Instance *); | |
231 void (*unmap_subwindow_method) (Lisp_Image_Instance *); | |
232 void (*map_subwindow_method) (Lisp_Image_Instance *, int x, int y, | |
233 struct display_glyph_area* dga); | |
234 void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h); | |
235 void (*redisplay_subwindow_method) (Lisp_Image_Instance *); | |
236 void (*redisplay_widget_method) (Lisp_Image_Instance *); | |
237 /* Maybe this should be a specifier. Unfortunately specifiers don't | |
238 allow us to represent things at the toolkit level, which is what | |
239 is required here. */ | |
240 int (*widget_border_width_method) (void); | |
241 int (*widget_spacing_method) (Lisp_Image_Instance *); | |
242 int (*image_instance_equal_method) (Lisp_Image_Instance *, | |
243 Lisp_Image_Instance *, | |
244 int depth); | |
245 Hashcode (*image_instance_hash_method) (Lisp_Image_Instance *, | |
246 int depth); | |
247 void (*init_image_instance_from_eimage_method) (Lisp_Image_Instance *ii, | |
248 int width, int height, | |
249 int slices, | |
250 unsigned char *eimage, | |
251 int dest_mask, | |
252 Lisp_Object instantiator, | |
253 Lisp_Object domain); | |
254 Lisp_Object (*locate_pixmap_file_method) (Lisp_Object file_method); | |
255 int (*colorize_image_instance_method) (Lisp_Object image_instance, | |
256 Lisp_Object fg, Lisp_Object bg); | |
257 void (*widget_query_string_geometry_method) (Lisp_Object string, | |
258 Lisp_Object face, | |
259 int* width, int* height, | |
260 Lisp_Object domain); | |
261 Lisp_Object image_conversion_list; | |
262 | |
263 #ifdef HAVE_TOOLBARS | |
264 /* toolbar methods */ | |
265 void (*output_frame_toolbars_method) (struct frame *); | |
905 | 266 void (*clear_frame_toolbars_method) (struct frame *); |
872 | 267 void (*initialize_frame_toolbars_method) (struct frame *); |
268 void (*free_frame_toolbars_method) (struct frame *); | |
269 void (*output_toolbar_button_method) (struct frame *, Lisp_Object); | |
270 void (*redraw_frame_toolbars_method) (struct frame *); | |
271 void (*redraw_exposed_toolbars_method) (struct frame *f, int x, int y, | |
272 int width, int height); | |
273 #endif | |
274 | |
275 #ifdef HAVE_SCROLLBARS | |
276 /* scrollbar methods */ | |
277 int (*inhibit_scrollbar_slider_size_change_method) (void); | |
278 void (*free_scrollbar_instance_method) (struct scrollbar_instance *); | |
279 void (*release_scrollbar_instance_method) (struct scrollbar_instance *); | |
280 void (*create_scrollbar_instance_method) (struct frame *, int, | |
281 struct scrollbar_instance *); | |
282 void (*update_scrollbar_instance_values_method) (struct window *, | |
283 struct scrollbar_instance *, | |
284 int, int, int, int, int, | |
285 int, int, int, int, int); | |
286 void (*update_scrollbar_instance_status_method) (struct window *, int, int, | |
287 struct | |
288 scrollbar_instance *); | |
289 void (*scrollbar_pointer_changed_in_window_method) (struct window *w); | |
290 #ifdef MEMORY_USAGE_STATS | |
291 int (*compute_scrollbar_instance_usage_method) (struct device *, | |
292 struct scrollbar_instance *, | |
293 struct overhead_stats *); | |
294 #endif | |
1318 | 295 /* Paint the window's deadbox, a rectangle between window |
296 borders and two short edges of both scrollbars. */ | |
297 void (*redisplay_deadbox_method) (struct window *w, int x, int y, int width, | |
298 int height); | |
872 | 299 #endif /* HAVE_SCROLLBARS */ |
300 | |
301 #ifdef HAVE_MENUBARS | |
302 /* menubar methods */ | |
303 void (*update_frame_menubars_method) (struct frame *); | |
304 void (*free_frame_menubars_method) (struct frame *); | |
305 #endif | |
306 | |
307 #ifdef HAVE_DIALOGS | |
308 /* dialog methods */ | |
309 Lisp_Object (*make_dialog_box_internal_method) (struct frame *, | |
310 Lisp_Object type, | |
311 Lisp_Object keys); | |
312 #endif | |
313 }; | |
314 | |
315 #define CONMETH_TYPE(meths) ((meths)->symbol) | |
316 #define CONMETH_IMPL_FLAG(meths, f) ((meths)->flags & (f)) | |
317 | |
318 #define CONSOLE_TYPE_NAME(c) ((c)->conmeths->name) | |
319 #define CONSOLE_TYPE(c) ((c)->conmeths->symbol) | |
320 #define CONSOLE_IMPL_FLAG(c, f) CONMETH_IMPL_FLAG ((c)->conmeths, (f)) | |
321 | |
322 /******** Accessing / calling a console method *********/ | |
323 | |
324 #define HAS_CONTYPE_METH_P(meth, m) ((meth)->m##_method) | |
325 #define CONTYPE_METH(meth, m, args) (((meth)->m##_method) args) | |
326 | |
327 /* Call a void-returning console method, if it exists */ | |
328 #define MAYBE_CONTYPE_METH(meth, m, args) do { \ | |
329 struct console_methods *maybe_contype_meth_meth = (meth); \ | |
330 if (HAS_CONTYPE_METH_P (maybe_contype_meth_meth, m)) \ | |
331 CONTYPE_METH (maybe_contype_meth_meth, m, args); \ | |
332 } while (0) | |
333 | |
334 /* Call a console method, if it exists; otherwise return | |
335 the specified value - meth is multiply evaluated. */ | |
336 #define CONTYPE_METH_OR_GIVEN(meth, m, args, given) \ | |
337 (HAS_CONTYPE_METH_P (meth, m) ? \ | |
338 CONTYPE_METH (meth, m, args) : (given)) | |
339 | |
340 /* Call an int-returning console method, if it exists; otherwise | |
341 return 0 */ | |
342 #define MAYBE_INT_CONTYPE_METH(meth, m, args) \ | |
343 CONTYPE_METH_OR_GIVEN (meth, m, args, 0) | |
344 | |
345 /* Call an Lisp-Object-returning console method, if it exists; | |
346 otherwise return Qnil */ | |
347 #define MAYBE_LISP_CONTYPE_METH(meth, m, args) \ | |
348 CONTYPE_METH_OR_GIVEN (meth, m, args, Qnil) | |
349 | |
350 /******** Same functions, operating on a console instead of a | |
351 struct console_methods ********/ | |
352 | |
353 #define HAS_CONMETH_P(c, m) HAS_CONTYPE_METH_P ((c)->conmeths, m) | |
354 #define CONMETH(c, m, args) CONTYPE_METH ((c)->conmeths, m, args) | |
355 #define MAYBE_CONMETH(c, m, args) MAYBE_CONTYPE_METH ((c)->conmeths, m, args) | |
356 #define CONMETH_OR_GIVEN(c, m, args, given) \ | |
357 CONTYPE_METH_OR_GIVEN((c)->conmeths, m, args, given) | |
358 #define MAYBE_INT_CONMETH(c, m, args) \ | |
359 MAYBE_INT_CONTYPE_METH ((c)->conmeths, m, args) | |
360 #define MAYBE_LISP_CONMETH(c, m, args) \ | |
361 MAYBE_LISP_CONTYPE_METH ((c)->conmeths, m, args) | |
362 | |
363 /******** Defining new console types ********/ | |
364 | |
365 typedef struct console_type_entry console_type_entry; | |
366 struct console_type_entry | |
367 { | |
368 Lisp_Object symbol; | |
369 struct console_methods *meths; | |
370 }; | |
371 | |
372 #define DECLARE_CONSOLE_TYPE(type) \ | |
373 extern struct console_methods * type##_console_methods | |
374 | |
375 #define DEFINE_CONSOLE_TYPE(type) \ | |
376 struct console_methods * type##_console_methods | |
377 | |
378 #define INITIALIZE_CONSOLE_TYPE(type, obj_name, pred_sym) do { \ | |
379 type##_console_methods = xnew_and_zero (struct console_methods); \ | |
380 type##_console_methods->name = obj_name; \ | |
381 type##_console_methods->symbol = Q##type; \ | |
382 defsymbol_nodump (&type##_console_methods->predicate_symbol, pred_sym); \ | |
383 add_entry_to_console_type_list (Q##type, type##_console_methods); \ | |
384 type##_console_methods->image_conversion_list = Qnil; \ | |
385 staticpro_nodump (&type##_console_methods->image_conversion_list); \ | |
2367 | 386 dump_add_root_block_ptr (&type##_console_methods, &console_methods_description); \ |
872 | 387 } while (0) |
388 | |
389 #define REINITIALIZE_CONSOLE_TYPE(type) do { \ | |
390 staticpro_nodump (&type##_console_methods->predicate_symbol); \ | |
391 staticpro_nodump (&type##_console_methods->image_conversion_list); \ | |
392 } while (0) | |
393 | |
394 | |
395 /* Declare that console-type TYPE has method M; used in | |
396 initialization routines */ | |
397 #define CONSOLE_HAS_METHOD(type, m) \ | |
398 (type##_console_methods->m##_method = type##_##m) | |
399 | |
400 /* Declare that console-type TYPE inherits method M | |
401 implementation from console-type FROMTYPE */ | |
402 #define CONSOLE_INHERITS_METHOD(type, fromtype, m) \ | |
403 (type##_console_methods->m##_method = fromtype##_##m) | |
404 | |
405 /* Define console type implementation flags */ | |
406 #define CONSOLE_IMPLEMENTATION_FLAGS(type, flg) \ | |
407 (type##_console_methods->flags = flg) | |
408 | |
409 struct console | |
410 { | |
2720 | 411 #ifdef MC_ALLOC |
412 struct lrecord_header header; | |
413 #else /* MC_ALLOC */ | |
872 | 414 struct lcrecord_header header; |
2720 | 415 #endif /* MC_ALLOC */ |
872 | 416 |
417 /* Description of this console's methods. */ | |
418 struct console_methods *conmeths; | |
419 | |
1204 | 420 /* Enumerated constant listing which type of console this is (TTY, X, |
421 MS-Windows, etc.). This duplicates the symbol in conmeths->symbol, | |
422 which formerly was the only way to determine the console type. | |
423 We need this constant now for KKCC, so that it can be used in | |
424 an XD_UNION clause to determine the Lisp objects in console_data. */ | |
934 | 425 enum console_variant contype; |
426 | |
872 | 427 /* A structure of auxiliary data specific to the console type. |
428 struct x_console is used for X window frames; defined in console-x.h | |
429 struct tty_console is used to TTY's; defined in console-tty.h */ | |
430 void *console_data; | |
431 | |
432 /* ----- begin partially-completed console localization of | |
433 event loop ---- */ | |
434 | |
435 int local_var_flags; | |
436 | |
1204 | 437 #define MARKED_SLOT(x) Lisp_Object x; |
872 | 438 #include "conslots.h" |
439 | |
440 /* Where to store the next keystroke of the macro. | |
441 Index into con->kbd_macro_builder. */ | |
442 int kbd_macro_ptr; | |
443 | |
444 /* The finalized section of the macro starts at kbd_macro_buffer and | |
445 ends before this. This is not the same as kbd_macro_pointer, because | |
446 we advance this to kbd_macro_pointer when a key's command is complete. | |
447 This way, the keystrokes for "end-kbd-macro" are not included in the | |
448 macro. */ | |
449 int kbd_macro_end; | |
450 | |
451 /* ----- end partially-completed console localization of event loop ---- */ | |
452 | |
453 unsigned int input_enabled :1; | |
454 }; | |
455 | |
456 /* Redefine basic properties more efficiently */ | |
457 | |
458 #undef CONSOLE_LIVE_P | |
459 #define CONSOLE_LIVE_P(con) (!EQ (CONSOLE_TYPE (con), Qdead)) | |
460 #undef CONSOLE_DEVICE_LIST | |
461 #define CONSOLE_DEVICE_LIST(con) ((con)->device_list) | |
462 | |
463 #define CONSOLE_TYPE_P(con, type) EQ (CONSOLE_TYPE (con), Q##type) | |
464 | |
465 #ifdef ERROR_CHECK_TYPES | |
466 DECLARE_INLINE_HEADER ( | |
467 struct console * | |
468 error_check_console_type (struct console *con, Lisp_Object sym) | |
469 ) | |
470 { | |
471 assert (EQ (CONSOLE_TYPE (con), sym)); | |
472 return con; | |
473 } | |
474 # define CONSOLE_TYPE_DATA(con, type) \ | |
475 (*(struct type##_console **) \ | |
476 &(error_check_console_type (con, Q##type))->console_data) | |
477 #else | |
478 # define CONSOLE_TYPE_DATA(con, type) \ | |
479 (*(struct type##_console **) &((con)->console_data)) | |
480 #endif | |
481 | |
482 #define CHECK_CONSOLE_TYPE(x, type) do { \ | |
483 CHECK_CONSOLE (x); \ | |
484 if (! CONSOLE_TYPE_P (XCONSOLE (x), type)) \ | |
485 dead_wrong_type_argument \ | |
486 (type##_console_methods->predicate_symbol, x); \ | |
487 } while (0) | |
488 #define CONCHECK_CONSOLE_TYPE(x, type) do { \ | |
489 CONCHECK_CONSOLE (x); \ | |
490 if (!(CONSOLEP (x) && \ | |
491 CONSOLE_TYPE_P (XCONSOLE (x), type))) \ | |
492 x = wrong_type_argument \ | |
493 (type##_console_methods->predicate_symbol, x); \ | |
494 } while (0) | |
495 | |
496 /* #### These should be in the console-*.h files but there are | |
497 too many places where the abstraction is broken. Need to | |
498 fix. */ | |
499 | |
500 #ifdef HAVE_GTK | |
501 #define CONSOLE_TYPESYM_GTK_P(typesym) EQ (typesym, Qgtk) | |
502 #else | |
503 #define CONSOLE_TYPESYM_GTK_P(typesym) 0 | |
504 #endif | |
505 | |
506 #ifdef HAVE_X_WINDOWS | |
507 #define CONSOLE_TYPESYM_X_P(typesym) EQ (typesym, Qx) | |
508 #else | |
509 #define CONSOLE_TYPESYM_X_P(typesym) 0 | |
510 #endif | |
511 #ifdef HAVE_TTY | |
512 #define CONSOLE_TYPESYM_TTY_P(typesym) EQ (typesym, Qtty) | |
513 #else | |
514 #define CONSOLE_TYPESYM_TTY_P(typesym) 0 | |
515 #endif | |
516 #ifdef HAVE_MS_WINDOWS | |
517 #define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) EQ (typesym, Qmswindows) | |
518 #else | |
519 #define CONSOLE_TYPESYM_MSWINDOWS_P(typesym) 0 | |
520 #endif | |
521 #define CONSOLE_TYPESYM_STREAM_P(typesym) EQ (typesym, Qstream) | |
522 | |
523 #define CONSOLE_TYPESYM_WIN_P(typesym) \ | |
524 (CONSOLE_TYPESYM_GTK_P (typesym) || CONSOLE_TYPESYM_X_P (typesym) || CONSOLE_TYPESYM_MSWINDOWS_P (typesym)) | |
525 | |
526 #define CONSOLE_X_P(con) CONSOLE_TYPESYM_X_P (CONSOLE_TYPE (con)) | |
527 #define CHECK_X_CONSOLE(z) CHECK_CONSOLE_TYPE (z, x) | |
528 #define CONCHECK_X_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, x) | |
529 | |
530 #define CONSOLE_GTK_P(con) CONSOLE_TYPESYM_GTK_P (CONSOLE_TYPE (con)) | |
531 #define CHECK_GTK_CONSOLE(z) CHECK_CONSOLE_TYPE (z, gtk) | |
532 #define CONCHECK_GTK_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, gtk) | |
533 | |
534 #define CONSOLE_TTY_P(con) CONSOLE_TYPESYM_TTY_P (CONSOLE_TYPE (con)) | |
535 #define CHECK_TTY_CONSOLE(z) CHECK_CONSOLE_TYPE (z, tty) | |
536 #define CONCHECK_TTY_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, tty) | |
537 | |
538 #define CONSOLE_MSWINDOWS_P(con) CONSOLE_TYPESYM_MSWINDOWS_P (CONSOLE_TYPE (con)) | |
539 #define CHECK_MSWINDOWS_CONSOLE(z) CHECK_CONSOLE_TYPE (z, mswindows) | |
540 #define CONCHECK_MSWINDOWS_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, mswindows) | |
541 | |
542 #define CONSOLE_STREAM_P(con) CONSOLE_TYPESYM_STREAM_P (CONSOLE_TYPE (con)) | |
543 #define CHECK_STREAM_CONSOLE(z) CHECK_CONSOLE_TYPE (z, stream) | |
544 #define CONCHECK_STREAM_CONSOLE(z) CONCHECK_CONSOLE_TYPE (z, stream) | |
545 | |
546 #define CONSOLE_WIN_P(con) CONSOLE_TYPESYM_WIN_P (CONSOLE_TYPE (con)) | |
547 | |
548 /* This structure marks which slots in a console have corresponding | |
549 default values in console_defaults. | |
550 Each such slot has a nonzero value in this structure. | |
551 The value has only one nonzero bit. | |
552 | |
553 When a console has its own local value for a slot, | |
554 the bit for that slot (found in the same slot in this structure) | |
555 is turned on in the console's local_var_flags slot. | |
556 | |
557 If a slot in this structure is zero, then even though there may | |
558 be a DEFVAR_CONSOLE_LOCAL for the slot, there is no default value for it; | |
559 and the corresponding slot in console_defaults is not used. */ | |
560 | |
561 extern struct console console_local_flags; | |
562 | |
563 #define CONSOLE_NAME(con) ((con)->name) | |
564 #define CONSOLE_CONNECTION(con) ((con)->connection) | |
565 #define CONSOLE_CANON_CONNECTION(con) ((con)->canon_connection) | |
566 #define CONSOLE_FUNCTION_KEY_MAP(con) ((con)->function_key_map) | |
567 #define CONSOLE_SELECTED_DEVICE(con) ((con)->selected_device) | |
568 #define CONSOLE_SELECTED_FRAME(con) \ | |
569 DEVICE_SELECTED_FRAME (XDEVICE ((con)->selected_device)) | |
570 #define CONSOLE_LAST_NONMINIBUF_FRAME(con) NON_LVALUE ((con)->last_nonminibuf_frame) | |
571 #define CONSOLE_QUIT_CHAR(con) ((con)->quit_char) | |
1204 | 572 #define CONSOLE_QUIT_EVENT(con) ((con)->quit_event) |
573 #define CONSOLE_CRITICAL_QUIT_EVENT(con) ((con)->critical_quit_event) | |
872 | 574 |
575 DECLARE_CONSOLE_TYPE (dead); | |
576 | |
577 extern console_type_entry_dynarr *the_console_type_entry_dynarr; | |
578 | |
579 #endif /* INCLUDED_console_impl_h_ */ |