Mercurial > hg > xemacs-beta
annotate src/mule-charset.c @ 5127:a9c41067dd88 ben-lisp-object
more cleanups, terminology clarification, lots of doc work
-------------------- ChangeLog entries follow: --------------------
man/ChangeLog addition:
2010-03-05 Ben Wing <ben@xemacs.org>
* internals/internals.texi (Introduction to Allocation):
* internals/internals.texi (Integers and Characters):
* internals/internals.texi (Allocation from Frob Blocks):
* internals/internals.texi (lrecords):
* internals/internals.texi (Low-level allocation):
Rewrite section on allocation of Lisp objects to reflect the new
reality. Remove references to nonexistent XSETINT and XSETCHAR.
modules/ChangeLog addition:
2010-03-05 Ben Wing <ben@xemacs.org>
* postgresql/postgresql.c (allocate_pgconn):
* postgresql/postgresql.c (allocate_pgresult):
* postgresql/postgresql.h (struct Lisp_PGconn):
* postgresql/postgresql.h (struct Lisp_PGresult):
* ldap/eldap.c (allocate_ldap):
* ldap/eldap.h (struct Lisp_LDAP):
Same changes as in src/ dir. See large log there in ChangeLog,
but basically:
ALLOC_LISP_OBJECT -> ALLOC_NORMAL_LISP_OBJECT
LISP_OBJECT_HEADER -> NORMAL_LISP_OBJECT_HEADER
../hlo/src/ChangeLog addition:
2010-03-05 Ben Wing <ben@xemacs.org>
* alloc.c:
* alloc.c (old_alloc_sized_lcrecord):
* alloc.c (very_old_free_lcrecord):
* alloc.c (copy_lisp_object):
* alloc.c (zero_sized_lisp_object):
* alloc.c (zero_nonsized_lisp_object):
* alloc.c (lisp_object_storage_size):
* alloc.c (free_normal_lisp_object):
* alloc.c (FREE_FIXED_TYPE_WHEN_NOT_IN_GC):
* alloc.c (ALLOC_FROB_BLOCK_LISP_OBJECT):
* alloc.c (Fcons):
* alloc.c (noseeum_cons):
* alloc.c (make_float):
* alloc.c (make_bignum):
* alloc.c (make_bignum_bg):
* alloc.c (make_ratio):
* alloc.c (make_ratio_bg):
* alloc.c (make_ratio_rt):
* alloc.c (make_bigfloat):
* alloc.c (make_bigfloat_bf):
* alloc.c (size_vector):
* alloc.c (make_compiled_function):
* alloc.c (Fmake_symbol):
* alloc.c (allocate_extent):
* alloc.c (allocate_event):
* alloc.c (make_key_data):
* alloc.c (make_button_data):
* alloc.c (make_motion_data):
* alloc.c (make_process_data):
* alloc.c (make_timeout_data):
* alloc.c (make_magic_data):
* alloc.c (make_magic_eval_data):
* alloc.c (make_eval_data):
* alloc.c (make_misc_user_data):
* alloc.c (Fmake_marker):
* alloc.c (noseeum_make_marker):
* alloc.c (size_string_direct_data):
* alloc.c (make_uninit_string):
* alloc.c (make_string_nocopy):
* alloc.c (mark_lcrecord_list):
* alloc.c (alloc_managed_lcrecord):
* alloc.c (free_managed_lcrecord):
* alloc.c (sweep_lcrecords_1):
* alloc.c (malloced_storage_size):
* buffer.c (allocate_buffer):
* buffer.c (compute_buffer_usage):
* buffer.c (DEFVAR_BUFFER_LOCAL_1):
* buffer.c (nuke_all_buffer_slots):
* buffer.c (common_init_complex_vars_of_buffer):
* buffer.h (struct buffer_text):
* buffer.h (struct buffer):
* bytecode.c:
* bytecode.c (make_compiled_function_args):
* bytecode.c (size_compiled_function_args):
* bytecode.h (struct compiled_function_args):
* casetab.c (allocate_case_table):
* casetab.h (struct Lisp_Case_Table):
* charset.h (struct Lisp_Charset):
* chartab.c (fill_char_table):
* chartab.c (Fmake_char_table):
* chartab.c (make_char_table_entry):
* chartab.c (copy_char_table_entry):
* chartab.c (Fcopy_char_table):
* chartab.c (put_char_table):
* chartab.h (struct Lisp_Char_Table_Entry):
* chartab.h (struct Lisp_Char_Table):
* console-gtk-impl.h (struct gtk_device):
* console-gtk-impl.h (struct gtk_frame):
* console-impl.h (struct console):
* console-msw-impl.h (struct Lisp_Devmode):
* console-msw-impl.h (struct mswindows_device):
* console-msw-impl.h (struct msprinter_device):
* console-msw-impl.h (struct mswindows_frame):
* console-msw-impl.h (struct mswindows_dialog_id):
* console-stream-impl.h (struct stream_console):
* console-stream.c (stream_init_console):
* console-tty-impl.h (struct tty_console):
* console-tty-impl.h (struct tty_device):
* console-tty.c (allocate_tty_console_struct):
* console-x-impl.h (struct x_device):
* console-x-impl.h (struct x_frame):
* console.c (allocate_console):
* console.c (nuke_all_console_slots):
* console.c (DEFVAR_CONSOLE_LOCAL_1):
* console.c (common_init_complex_vars_of_console):
* data.c (make_weak_list):
* data.c (make_weak_box):
* data.c (make_ephemeron):
* database.c:
* database.c (struct Lisp_Database):
* database.c (allocate_database):
* database.c (finalize_database):
* device-gtk.c (allocate_gtk_device_struct):
* device-impl.h (struct device):
* device-msw.c:
* device-msw.c (mswindows_init_device):
* device-msw.c (msprinter_init_device):
* device-msw.c (finalize_devmode):
* device-msw.c (allocate_devmode):
* device-tty.c (allocate_tty_device_struct):
* device-x.c (allocate_x_device_struct):
* device.c:
* device.c (nuke_all_device_slots):
* device.c (allocate_device):
* dialog-msw.c (handle_question_dialog_box):
* elhash.c:
* elhash.c (struct Lisp_Hash_Table):
* elhash.c (finalize_hash_table):
* elhash.c (make_general_lisp_hash_table):
* elhash.c (Fcopy_hash_table):
* elhash.h (htentry):
* emacs.c (main_1):
* eval.c:
* eval.c (size_multiple_value):
* event-stream.c (finalize_command_builder):
* event-stream.c (allocate_command_builder):
* event-stream.c (free_command_builder):
* event-stream.c (event_stream_generate_wakeup):
* event-stream.c (event_stream_resignal_wakeup):
* event-stream.c (event_stream_disable_wakeup):
* event-stream.c (event_stream_wakeup_pending_p):
* events.h (struct Lisp_Timeout):
* events.h (struct command_builder):
* extents-impl.h:
* extents-impl.h (struct extent_auxiliary):
* extents-impl.h (struct extent_info):
* extents-impl.h (set_extent_no_chase_aux_field):
* extents-impl.h (set_extent_no_chase_normal_field):
* extents.c:
* extents.c (gap_array_marker):
* extents.c (gap_array):
* extents.c (extent_list_marker):
* extents.c (extent_list):
* extents.c (stack_of_extents):
* extents.c (gap_array_make_marker):
* extents.c (extent_list_make_marker):
* extents.c (allocate_extent_list):
* extents.c (SLOT):
* extents.c (mark_extent_auxiliary):
* extents.c (allocate_extent_auxiliary):
* extents.c (attach_extent_auxiliary):
* extents.c (size_gap_array):
* extents.c (finalize_extent_info):
* extents.c (allocate_extent_info):
* extents.c (uninit_buffer_extents):
* extents.c (allocate_soe):
* extents.c (copy_extent):
* extents.c (vars_of_extents):
* extents.h:
* faces.c (allocate_face):
* faces.h (struct Lisp_Face):
* faces.h (struct face_cachel):
* file-coding.c:
* file-coding.c (finalize_coding_system):
* file-coding.c (sizeof_coding_system):
* file-coding.c (Fcopy_coding_system):
* file-coding.h (struct Lisp_Coding_System):
* file-coding.h (MARKED_SLOT):
* fns.c (size_bit_vector):
* font-mgr.c:
* font-mgr.c (finalize_fc_pattern):
* font-mgr.c (print_fc_pattern):
* font-mgr.c (Ffc_pattern_p):
* font-mgr.c (Ffc_pattern_create):
* font-mgr.c (Ffc_name_parse):
* font-mgr.c (Ffc_name_unparse):
* font-mgr.c (Ffc_pattern_duplicate):
* font-mgr.c (Ffc_pattern_add):
* font-mgr.c (Ffc_pattern_del):
* font-mgr.c (Ffc_pattern_get):
* font-mgr.c (fc_config_create_using):
* font-mgr.c (fc_strlist_to_lisp_using):
* font-mgr.c (fontset_to_list):
* font-mgr.c (Ffc_config_p):
* font-mgr.c (Ffc_config_up_to_date):
* font-mgr.c (Ffc_config_build_fonts):
* font-mgr.c (Ffc_config_get_cache):
* font-mgr.c (Ffc_config_get_fonts):
* font-mgr.c (Ffc_config_set_current):
* font-mgr.c (Ffc_config_get_blanks):
* font-mgr.c (Ffc_config_get_rescan_interval):
* font-mgr.c (Ffc_config_set_rescan_interval):
* font-mgr.c (Ffc_config_app_font_add_file):
* font-mgr.c (Ffc_config_app_font_add_dir):
* font-mgr.c (Ffc_config_app_font_clear):
* font-mgr.c (size):
* font-mgr.c (Ffc_config_substitute):
* font-mgr.c (Ffc_font_render_prepare):
* font-mgr.c (Ffc_font_match):
* font-mgr.c (Ffc_font_sort):
* font-mgr.c (finalize_fc_config):
* font-mgr.c (print_fc_config):
* font-mgr.h:
* font-mgr.h (struct fc_pattern):
* font-mgr.h (XFC_PATTERN):
* font-mgr.h (struct fc_config):
* font-mgr.h (XFC_CONFIG):
* frame-gtk.c (allocate_gtk_frame_struct):
* frame-impl.h (struct frame):
* frame-msw.c (mswindows_init_frame_1):
* frame-x.c (allocate_x_frame_struct):
* frame.c (nuke_all_frame_slots):
* frame.c (allocate_frame_core):
* gc.c:
* gc.c (GC_CHECK_NOT_FREE):
* glyphs.c (finalize_image_instance):
* glyphs.c (allocate_image_instance):
* glyphs.c (Fcolorize_image_instance):
* glyphs.c (allocate_glyph):
* glyphs.c (unmap_subwindow_instance_cache_mapper):
* glyphs.c (register_ignored_expose):
* glyphs.h (struct Lisp_Image_Instance):
* glyphs.h (struct Lisp_Glyph):
* glyphs.h (struct glyph_cachel):
* glyphs.h (struct expose_ignore):
* gui.c (allocate_gui_item):
* gui.h (struct Lisp_Gui_Item):
* keymap.c (struct Lisp_Keymap):
* keymap.c (make_keymap):
* lisp.h:
* lisp.h (struct Lisp_String_Direct_Data):
* lisp.h (struct Lisp_String_Indirect_Data):
* lisp.h (struct Lisp_Vector):
* lisp.h (struct Lisp_Bit_Vector):
* lisp.h (DECLARE_INLINE_LISP_BIT_VECTOR):
* lisp.h (struct weak_box):
* lisp.h (struct ephemeron):
* lisp.h (struct weak_list):
* lrecord.h:
* lrecord.h (struct lrecord_implementation):
* lrecord.h (MC_ALLOC_CALL_FINALIZER):
* lrecord.h (struct lcrecord_list):
* lstream.c (finalize_lstream):
* lstream.c (sizeof_lstream):
* lstream.c (Lstream_new):
* lstream.c (Lstream_delete):
* lstream.h (struct lstream):
* marker.c:
* marker.c (finalize_marker):
* marker.c (compute_buffer_marker_usage):
* mule-charset.c:
* mule-charset.c (make_charset):
* mule-charset.c (compute_charset_usage):
* objects-impl.h (struct Lisp_Color_Instance):
* objects-impl.h (struct Lisp_Font_Instance):
* objects-tty-impl.h (struct tty_color_instance_data):
* objects-tty-impl.h (struct tty_font_instance_data):
* objects-tty.c (tty_initialize_color_instance):
* objects-tty.c (tty_initialize_font_instance):
* objects.c (finalize_color_instance):
* objects.c (Fmake_color_instance):
* objects.c (finalize_font_instance):
* objects.c (Fmake_font_instance):
* objects.c (reinit_vars_of_objects):
* opaque.c:
* opaque.c (sizeof_opaque):
* opaque.c (make_opaque_ptr):
* opaque.c (free_opaque_ptr):
* opaque.h:
* opaque.h (Lisp_Opaque):
* opaque.h (Lisp_Opaque_Ptr):
* print.c (printing_unreadable_lcrecord):
* print.c (external_object_printer):
* print.c (debug_p4):
* process.c (finalize_process):
* process.c (make_process_internal):
* procimpl.h (struct Lisp_Process):
* rangetab.c (Fmake_range_table):
* rangetab.c (Fcopy_range_table):
* rangetab.h (struct Lisp_Range_Table):
* scrollbar.c:
* scrollbar.c (create_scrollbar_instance):
* scrollbar.c (compute_scrollbar_instance_usage):
* scrollbar.h (struct scrollbar_instance):
* specifier.c (finalize_specifier):
* specifier.c (sizeof_specifier):
* specifier.c (set_specifier_caching):
* specifier.h (struct Lisp_Specifier):
* specifier.h (struct specifier_caching):
* symeval.h:
* symeval.h (SYMBOL_VALUE_MAGIC_P):
* symeval.h (DEFVAR_SYMVAL_FWD):
* symsinit.h:
* syntax.c (init_buffer_syntax_cache):
* syntax.h (struct syntax_cache):
* toolbar.c:
* toolbar.c (allocate_toolbar_button):
* toolbar.c (update_toolbar_button):
* toolbar.h (struct toolbar_button):
* tooltalk.c (struct Lisp_Tooltalk_Message):
* tooltalk.c (make_tooltalk_message):
* tooltalk.c (struct Lisp_Tooltalk_Pattern):
* tooltalk.c (make_tooltalk_pattern):
* ui-gtk.c:
* ui-gtk.c (allocate_ffi_data):
* ui-gtk.c (emacs_gtk_object_finalizer):
* ui-gtk.c (allocate_emacs_gtk_object_data):
* ui-gtk.c (allocate_emacs_gtk_boxed_data):
* ui-gtk.h:
* window-impl.h (struct window):
* window-impl.h (struct window_mirror):
* window.c (finalize_window):
* window.c (allocate_window):
* window.c (new_window_mirror):
* window.c (mark_window_as_deleted):
* window.c (make_dummy_parent):
* window.c (compute_window_mirror_usage):
* window.c (compute_window_usage):
Overall point of this change and previous ones in this repository:
(1) Introduce new, clearer terminology: everything other than int
or char is a "record" object, which comes in two types: "normal
objects" and "frob-block objects". Fix up all places that
referred to frob-block objects as "simple", "basic", etc.
(2) Provide an advertised interface for doing operations on Lisp
objects, including creating new types, that is clean and
consistent in its naming, uses the above-referenced terms and
avoids referencing "lrecords", "old lcrecords", etc., which should
hide under the surface.
(3) Make the size_in_bytes and finalizer methods take a
Lisp_Object rather than a void * for consistency with other methods.
(4) Separate finalizer method into finalizer and disksaver, so
that normal finalize methods don't have to worry about disksaving.
Other specifics:
(1) Renaming:
LISP_OBJECT_HEADER -> NORMAL_LISP_OBJECT_HEADER
ALLOC_LISP_OBJECT -> ALLOC_NORMAL_LISP_OBJECT
implementation->basic_p -> implementation->frob_block_p
ALLOCATE_FIXED_TYPE_AND_SET_IMPL -> ALLOC_FROB_BLOCK_LISP_OBJECT
*FCCONFIG*, wrap_fcconfig -> *FC_CONFIG*, wrap_fc_config
*FCPATTERN*, wrap_fcpattern -> *FC_PATTERN*, wrap_fc_pattern
(the last two changes make the naming of these macros consistent
with the naming of all other macros, since the objects are named
fc-config and fc-pattern with a hyphen)
(2) Lots of documentation fixes in lrecord.h.
(3) Eliminate macros for copying, freeing, zeroing objects, getting
their storage size. Instead, new functions:
zero_sized_lisp_object()
zero_nonsized_lisp_object()
lisp_object_storage_size()
free_normal_lisp_object()
(copy_lisp_object() already exists)
LISP_OBJECT_FROB_BLOCK_P() (actually a macro)
Eliminated:
free_lrecord()
zero_lrecord()
copy_lrecord()
copy_sized_lrecord()
old_copy_lcrecord()
old_copy_sized_lcrecord()
old_zero_lcrecord()
old_zero_sized_lcrecord()
LISP_OBJECT_STORAGE_SIZE()
COPY_SIZED_LISP_OBJECT()
COPY_SIZED_LCRECORD()
COPY_LISP_OBJECT()
ZERO_LISP_OBJECT()
FREE_LISP_OBJECT()
(4) Catch the remaining places where lrecord stuff was used directly
and use the advertised interface, e.g. alloc_sized_lrecord() ->
ALLOC_SIZED_LISP_OBJECT().
(5) Make certain statically-declared pseudo-objects
(buffer_local_flags, console_local_flags) have their lheader
initialized correctly, so things like copy_lisp_object() can work
on them. Make extent_auxiliary_defaults a proper heap object
Vextent_auxiliary_defaults, and make extent auxiliaries dumpable
so that this object can be dumped. allocate_extent_auxiliary()
now just creates the object, and attach_extent_auxiliary()
creates an extent auxiliary and attaches to an extent, like the
old allocate_extent_auxiliary().
(6) Create EXTENT_AUXILIARY_SLOTS macro, similar to the foo-slots.h
files but in a macro instead of a file. The purpose is to avoid
duplication when iterating over all the slots in an extent auxiliary.
Use it.
(7) In lstream.c, don't zero out object after allocation because
allocation routines take care of this.
(8) In marker.c, fix a mistake in computing marker overhead.
(9) In print.c, clean up printing_unreadable_lcrecord(),
external_object_printer() to avoid lots of ifdef NEW_GC's.
(10) Separate toolbar-button allocation into a separate
allocate_toolbar_button() function for use in the example code
in lrecord.h.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Fri, 05 Mar 2010 04:08:17 -0600 |
parents | b5df3737028a |
children | f965e31a35f0 |
rev | line source |
---|---|
428 | 1 /* Functions to handle multilingual characters. |
2 Copyright (C) 1992, 1995 Free Software Foundation, Inc. | |
3 Copyright (C) 1995 Sun Microsystems, Inc. | |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
4 Copyright (C) 2001, 2002, 2004, 2005, 2010 Ben Wing. |
428 | 5 |
6 This file is part of XEmacs. | |
7 | |
8 XEmacs is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
10 Free Software Foundation; either version 2, or (at your option) any | |
11 later version. | |
12 | |
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with XEmacs; see the file COPYING. If not, write to | |
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
21 Boston, MA 02111-1307, USA. */ | |
22 | |
23 /* Synched up with: FSF 20.3. Not in FSF. */ | |
24 | |
25 /* Rewritten by Ben Wing <ben@xemacs.org>. */ | |
26 | |
27 #include <config.h> | |
28 #include "lisp.h" | |
29 | |
30 #include "buffer.h" | |
31 #include "chartab.h" | |
32 #include "elhash.h" | |
33 #include "device.h" | |
34 #include "faces.h" | |
771 | 35 #include "lstream.h" |
428 | 36 #include "mule-ccl.h" |
872 | 37 #include "objects.h" |
3659 | 38 #include "specifier.h" |
428 | 39 |
40 /* The various pre-defined charsets. */ | |
41 | |
42 Lisp_Object Vcharset_ascii; | |
43 Lisp_Object Vcharset_control_1; | |
44 Lisp_Object Vcharset_latin_iso8859_1; | |
45 Lisp_Object Vcharset_latin_iso8859_2; | |
46 Lisp_Object Vcharset_latin_iso8859_3; | |
47 Lisp_Object Vcharset_latin_iso8859_4; | |
48 Lisp_Object Vcharset_thai_tis620; | |
49 Lisp_Object Vcharset_greek_iso8859_7; | |
4805
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
50 Lisp_Object Vcharset_arabic_iso8859_6; |
428 | 51 Lisp_Object Vcharset_hebrew_iso8859_8; |
52 Lisp_Object Vcharset_katakana_jisx0201; | |
53 Lisp_Object Vcharset_latin_jisx0201; | |
54 Lisp_Object Vcharset_cyrillic_iso8859_5; | |
55 Lisp_Object Vcharset_latin_iso8859_9; | |
728 | 56 Lisp_Object Vcharset_latin_iso8859_15; |
428 | 57 Lisp_Object Vcharset_japanese_jisx0208_1978; |
58 Lisp_Object Vcharset_chinese_gb2312; | |
59 Lisp_Object Vcharset_japanese_jisx0208; | |
60 Lisp_Object Vcharset_korean_ksc5601; | |
61 Lisp_Object Vcharset_japanese_jisx0212; | |
62 Lisp_Object Vcharset_chinese_cns11643_1; | |
63 Lisp_Object Vcharset_chinese_cns11643_2; | |
64 Lisp_Object Vcharset_chinese_big5_1; | |
65 Lisp_Object Vcharset_chinese_big5_2; | |
66 Lisp_Object Vcharset_composite; | |
67 | |
68 struct charset_lookup *chlook; | |
69 | |
1204 | 70 static const struct memory_description charset_lookup_description_1[] = { |
771 | 71 { XD_LISP_OBJECT_ARRAY, offsetof (struct charset_lookup, charset_by_leading_byte), NUM_LEADING_BYTES+4*128*2 }, |
428 | 72 { XD_END } |
73 }; | |
74 | |
1204 | 75 static const struct sized_memory_description charset_lookup_description = { |
440 | 76 sizeof (struct charset_lookup), |
428 | 77 charset_lookup_description_1 |
78 }; | |
79 | |
80 Lisp_Object Qcharsetp; | |
81 | |
3664 | 82 /* Qdoc_string, Qdimension, Qchars, Qfinal defined in general.c */ |
83 Lisp_Object Qregistries, Qgraphic, Qregistry; | |
428 | 84 Lisp_Object Qdirection; |
85 Lisp_Object Qreverse_direction_charset; | |
86 Lisp_Object Qshort_name, Qlong_name; | |
87 | |
4691
3ba90c659d01
Move Qfrom_unicode to general-slots.h, fix the native Win32 build.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4491
diff
changeset
|
88 Lisp_Object Qto_unicode; |
771 | 89 |
90 Lisp_Object | |
428 | 91 Qlatin_iso8859_1, |
92 Qlatin_iso8859_2, | |
93 Qlatin_iso8859_3, | |
94 Qlatin_iso8859_4, | |
95 Qthai_tis620, | |
96 Qgreek_iso8859_7, | |
4805
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
97 Qarabic_iso8859_6, |
428 | 98 Qhebrew_iso8859_8, |
99 Qkatakana_jisx0201, | |
100 Qlatin_jisx0201, | |
101 Qcyrillic_iso8859_5, | |
102 Qlatin_iso8859_9, | |
728 | 103 Qlatin_iso8859_15, |
428 | 104 Qjapanese_jisx0208_1978, |
105 Qchinese_gb2312, | |
106 Qjapanese_jisx0208, | |
107 Qkorean_ksc5601, | |
108 Qjapanese_jisx0212, | |
109 Qchinese_cns11643_1, | |
110 Qchinese_cns11643_2, | |
111 Qchinese_big5_1, | |
112 Qchinese_big5_2, | |
113 Qcomposite; | |
114 | |
115 Lisp_Object Ql2r, Qr2l; | |
116 | |
117 Lisp_Object Vcharset_hash_table; | |
118 | |
119 | |
120 /************************************************************************/ | |
121 /* charset object */ | |
122 /************************************************************************/ | |
123 | |
124 static Lisp_Object | |
125 mark_charset (Lisp_Object obj) | |
126 { | |
440 | 127 Lisp_Charset *cs = XCHARSET (obj); |
428 | 128 |
129 mark_object (cs->short_name); | |
130 mark_object (cs->long_name); | |
131 mark_object (cs->doc_string); | |
3659 | 132 mark_object (cs->registries); |
428 | 133 mark_object (cs->ccl_program); |
134 return cs->name; | |
135 } | |
136 | |
137 static void | |
2286 | 138 print_charset (Lisp_Object obj, Lisp_Object printcharfun, |
139 int UNUSED (escapeflag)) | |
428 | 140 { |
440 | 141 Lisp_Charset *cs = XCHARSET (obj); |
428 | 142 |
143 if (print_readably) | |
4846 | 144 printing_unreadable_lcrecord |
145 (obj, XSTRING_DATA (XSYMBOL (XCHARSET_NAME (obj))->name)); | |
428 | 146 |
771 | 147 write_fmt_string_lisp (printcharfun, "#<charset %s %S %S %S", 4, |
148 CHARSET_NAME (cs), CHARSET_SHORT_NAME (cs), | |
149 CHARSET_LONG_NAME (cs), CHARSET_DOC_STRING (cs)); | |
150 write_fmt_string (printcharfun, " %s %s cols=%d g%d final='%c' reg=", | |
151 CHARSET_TYPE (cs) == CHARSET_TYPE_94 ? "94" : | |
152 CHARSET_TYPE (cs) == CHARSET_TYPE_96 ? "96" : | |
153 CHARSET_TYPE (cs) == CHARSET_TYPE_94X94 ? "94x94" : | |
154 "96x96", | |
155 CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? "l2r" : | |
156 "r2l", | |
157 CHARSET_COLUMNS (cs), | |
158 CHARSET_GRAPHIC (cs), | |
159 CHARSET_FINAL (cs)); | |
3659 | 160 print_internal (CHARSET_REGISTRIES (cs), printcharfun, 0); |
771 | 161 write_fmt_string (printcharfun, " 0x%x>", cs->header.uid); |
162 } | |
163 | |
1204 | 164 static const struct memory_description charset_description[] = { |
165 { XD_INT, offsetof (Lisp_Charset, dimension) }, | |
166 { XD_INT, offsetof (Lisp_Charset, from_unicode_levels) }, | |
440 | 167 { XD_LISP_OBJECT, offsetof (Lisp_Charset, name) }, |
168 { XD_LISP_OBJECT, offsetof (Lisp_Charset, doc_string) }, | |
3659 | 169 { XD_LISP_OBJECT, offsetof (Lisp_Charset, registries) }, |
440 | 170 { XD_LISP_OBJECT, offsetof (Lisp_Charset, short_name) }, |
171 { XD_LISP_OBJECT, offsetof (Lisp_Charset, long_name) }, | |
172 { XD_LISP_OBJECT, offsetof (Lisp_Charset, reverse_direction_charset) }, | |
173 { XD_LISP_OBJECT, offsetof (Lisp_Charset, ccl_program) }, | |
771 | 174 { XD_UNION, offsetof (Lisp_Charset, to_unicode_table), |
2775 | 175 XD_INDIRECT (0, 0), { &to_unicode_description }, XD_FLAG_NO_KKCC }, |
771 | 176 { XD_UNION, offsetof (Lisp_Charset, from_unicode_table), |
2775 | 177 XD_INDIRECT (1, 0), { &from_unicode_description }, XD_FLAG_NO_KKCC }, |
428 | 178 { XD_END } |
179 }; | |
180 | |
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
diff
changeset
|
181 DEFINE_DUMPABLE_LISP_OBJECT ("charset", charset, |
5124
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
182 mark_charset, print_charset, 0, |
623d57b7fbe8
separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents:
5120
diff
changeset
|
183 0, 0, charset_description, Lisp_Charset); |
428 | 184 /* Make a new charset. */ |
446 | 185 /* #### SJT Should generic properties be allowed? */ |
428 | 186 static Lisp_Object |
771 | 187 make_charset (int id, Lisp_Object name, int rep_bytes, |
188 int type, int columns, int graphic, | |
867 | 189 Ibyte final, int direction, Lisp_Object short_name, |
428 | 190 Lisp_Object long_name, Lisp_Object doc, |
3439 | 191 Lisp_Object reg, int overwrite, int encode_as_utf_8) |
428 | 192 { |
193 Lisp_Object obj; | |
771 | 194 Lisp_Charset *cs; |
195 | |
196 if (!overwrite) | |
197 { | |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
198 obj = ALLOC_NORMAL_LISP_OBJECT (charset); |
5117
3742ea8250b5
Checking in final CVS version of workspace 'ben-lisp-object'
Ben Wing <ben@xemacs.org>
parents:
3025
diff
changeset
|
199 cs = XCHARSET (obj); |
771 | 200 |
201 if (final) | |
202 { | |
203 /* some charsets do not have final characters. This includes | |
204 ASCII, Control-1, Composite, and the two faux private | |
205 charsets. */ | |
206 assert (NILP (chlook-> | |
207 charset_by_attributes[type][final][direction])); | |
208 chlook->charset_by_attributes[type][final][direction] = obj; | |
209 } | |
440 | 210 |
771 | 211 assert (NILP (chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE])); |
212 chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE] = obj; | |
213 } | |
214 else | |
215 { | |
216 Lisp_Object ret; | |
217 /* Actually overwrite the properties of the existing charset. | |
218 We do this because until now charsets could never be "deleted", | |
219 so parts of the code don't bother to GC charsets. */ | |
220 obj = chlook->charset_by_leading_byte[id - MIN_LEADING_BYTE]; | |
221 cs = XCHARSET (obj); | |
222 assert (EQ (chlook->charset_by_attributes[type][final][direction], | |
223 obj)); | |
224 | |
225 ret = Fremhash (XCHARSET_NAME (obj), Vcharset_hash_table); | |
226 assert (!NILP (ret)); | |
227 } | |
428 | 228 |
229 CHARSET_ID (cs) = id; | |
230 CHARSET_NAME (cs) = name; | |
231 CHARSET_SHORT_NAME (cs) = short_name; | |
232 CHARSET_LONG_NAME (cs) = long_name; | |
233 CHARSET_REP_BYTES (cs) = rep_bytes; | |
234 CHARSET_DIRECTION (cs) = direction; | |
235 CHARSET_TYPE (cs) = type; | |
236 CHARSET_COLUMNS (cs) = columns; | |
237 CHARSET_GRAPHIC (cs) = graphic; | |
238 CHARSET_FINAL (cs) = final; | |
239 CHARSET_DOC_STRING (cs) = doc; | |
3659 | 240 CHECK_VECTOR(reg); |
241 CHARSET_REGISTRIES (cs) = reg; | |
3439 | 242 CHARSET_ENCODE_AS_UTF_8 (cs) = encode_as_utf_8 ? 1 : 0; |
428 | 243 CHARSET_CCL_PROGRAM (cs) = Qnil; |
244 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = Qnil; | |
245 | |
771 | 246 CHARSET_DIMENSION (cs) = (CHARSET_TYPE (cs) == CHARSET_TYPE_94 || |
247 CHARSET_TYPE (cs) == CHARSET_TYPE_96) ? 1 : 2; | |
248 CHARSET_CHARS (cs) = (CHARSET_TYPE (cs) == CHARSET_TYPE_94 || | |
249 CHARSET_TYPE (cs) == CHARSET_TYPE_94X94) ? 94 : 96; | |
428 | 250 |
771 | 251 if (id == LEADING_BYTE_ASCII || id == LEADING_BYTE_CONTROL_1 |
252 #ifdef ENABLE_COMPOSITE_CHARS | |
253 || id == LEADING_BYTE_COMPOSITE | |
254 #endif | |
255 ) | |
256 assert (!overwrite); | |
257 else | |
428 | 258 { |
771 | 259 if (overwrite) |
260 free_charset_unicode_tables (obj); | |
261 init_charset_unicode_tables (obj); | |
428 | 262 } |
263 | |
264 /* Some charsets are "faux" and don't have names or really exist at | |
265 all except in the leading-byte table. */ | |
266 if (!NILP (name)) | |
771 | 267 { |
268 assert (NILP (Fgethash (name, Vcharset_hash_table, Qnil))); | |
269 Fputhash (name, obj, Vcharset_hash_table); | |
270 } | |
271 | |
272 recalculate_unicode_precedence (); | |
3659 | 273 setup_charset_initial_specifier_tags (obj); |
274 | |
428 | 275 return obj; |
276 } | |
277 | |
278 static int | |
279 get_unallocated_leading_byte (int dimension) | |
280 { | |
281 int lb; | |
282 | |
283 if (dimension == 1) | |
284 { | |
771 | 285 if (chlook->next_allocated_1_byte_leading_byte > |
286 MAX_LEADING_BYTE_PRIVATE_1) | |
428 | 287 lb = 0; |
288 else | |
442 | 289 lb = chlook->next_allocated_1_byte_leading_byte++; |
428 | 290 } |
291 else | |
292 { | |
1747 | 293 /* awfully fragile, but correct */ |
294 #if MAX_LEADING_BYTE_PRIVATE_2 == 255 | |
295 if (chlook->next_allocated_2_byte_leading_byte == 0) | |
1749 | 296 #else |
771 | 297 if (chlook->next_allocated_2_byte_leading_byte > |
298 MAX_LEADING_BYTE_PRIVATE_2) | |
1747 | 299 #endif |
428 | 300 lb = 0; |
301 else | |
442 | 302 lb = chlook->next_allocated_2_byte_leading_byte++; |
428 | 303 } |
304 | |
305 if (!lb) | |
563 | 306 invalid_operation |
771 | 307 ("No more character sets free for this dimension", make_int (dimension)); |
428 | 308 |
309 return lb; | |
310 } | |
311 | |
312 | |
313 /************************************************************************/ | |
314 /* Basic charset Lisp functions */ | |
315 /************************************************************************/ | |
316 | |
788 | 317 void |
318 get_charset_limits (Lisp_Object charset, int *low, int *high) | |
319 { | |
320 Lisp_Charset *cs = XCHARSET (charset); | |
321 | |
322 if (EQ (charset, Vcharset_ascii)) *low = 0, *high = 127; | |
323 else if (EQ (charset, Vcharset_control_1)) *low = 0, *high = 31; | |
324 else if (CHARSET_CHARS (cs) == 94) *low = 33, *high = 126; | |
325 else /* CHARSET_CHARS (cs) == 96) */ *low = 32, *high = 127; | |
326 } | |
327 | |
428 | 328 DEFUN ("charsetp", Fcharsetp, 1, 1, 0, /* |
329 Return non-nil if OBJECT is a charset. | |
330 */ | |
331 (object)) | |
332 { | |
333 return CHARSETP (object) ? Qt : Qnil; | |
334 } | |
335 | |
336 DEFUN ("find-charset", Ffind_charset, 1, 1, 0, /* | |
337 Retrieve the charset of the given name. | |
338 If CHARSET-OR-NAME is a charset object, it is simply returned. | |
339 Otherwise, CHARSET-OR-NAME should be a symbol. If there is no such charset, | |
340 nil is returned. Otherwise the associated charset object is returned. | |
341 */ | |
342 (charset_or_name)) | |
343 { | |
344 if (CHARSETP (charset_or_name)) | |
345 return charset_or_name; | |
346 | |
347 CHECK_SYMBOL (charset_or_name); | |
348 return Fgethash (charset_or_name, Vcharset_hash_table, Qnil); | |
349 } | |
350 | |
351 DEFUN ("get-charset", Fget_charset, 1, 1, 0, /* | |
352 Retrieve the charset of the given name. | |
353 Same as `find-charset' except an error is signalled if there is no such | |
354 charset instead of returning nil. | |
355 */ | |
356 (name)) | |
357 { | |
358 Lisp_Object charset = Ffind_charset (name); | |
359 | |
360 if (NILP (charset)) | |
563 | 361 invalid_argument ("No such charset", name); |
428 | 362 return charset; |
363 } | |
364 | |
365 /* We store the charsets in hash tables with the names as the key and the | |
366 actual charset object as the value. Occasionally we need to use them | |
367 in a list format. These routines provide us with that. */ | |
368 struct charset_list_closure | |
369 { | |
370 Lisp_Object *charset_list; | |
371 }; | |
372 | |
373 static int | |
2286 | 374 add_charset_to_list_mapper (Lisp_Object UNUSED (key), Lisp_Object value, |
428 | 375 void *charset_list_closure) |
376 { | |
377 /* This function can GC */ | |
378 struct charset_list_closure *chcl = | |
379 (struct charset_list_closure*) charset_list_closure; | |
380 Lisp_Object *charset_list = chcl->charset_list; | |
381 | |
382 *charset_list = Fcons (XCHARSET_NAME (value), *charset_list); | |
383 return 0; | |
384 } | |
385 | |
386 DEFUN ("charset-list", Fcharset_list, 0, 0, 0, /* | |
387 Return a list of the names of all defined charsets. | |
388 */ | |
389 ()) | |
390 { | |
391 Lisp_Object charset_list = Qnil; | |
392 struct gcpro gcpro1; | |
393 struct charset_list_closure charset_list_closure; | |
394 | |
395 GCPRO1 (charset_list); | |
396 charset_list_closure.charset_list = &charset_list; | |
397 elisp_maphash (add_charset_to_list_mapper, Vcharset_hash_table, | |
398 &charset_list_closure); | |
399 UNGCPRO; | |
400 | |
401 return charset_list; | |
402 } | |
403 | |
404 DEFUN ("charset-name", Fcharset_name, 1, 1, 0, /* | |
444 | 405 Return the name of charset CHARSET. |
428 | 406 */ |
407 (charset)) | |
408 { | |
409 return XCHARSET_NAME (Fget_charset (charset)); | |
410 } | |
411 | |
446 | 412 /* #### SJT Should generic properties be allowed? */ |
428 | 413 DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /* |
414 Define a new character set. | |
415 This function is for use with Mule support. | |
416 NAME is a symbol, the name by which the character set is normally referred. | |
417 DOC-STRING is a string describing the character set. | |
418 PROPS is a property list, describing the specific nature of the | |
419 character set. Recognized properties are: | |
420 | |
3025 | 421 `short-name' Short version of the charset name (ex: Latin-1) |
422 `long-name' Long version of the charset name (ex: ISO8859-1 (Latin-1)) | |
3659 | 423 `registries' A vector of possible XLFD REGISTRY-ENCODING combinations for |
424 this character set. Note that this is not a regular expression. | |
3025 | 425 `dimension' Number of octets used to index a character in this charset. |
428 | 426 Either 1 or 2. Defaults to 1. |
3025 | 427 `columns' Number of columns used to display a character in this charset. |
428 | 428 Only used in TTY mode. (Under X, the actual width of a |
429 character can be derived from the font used to display the | |
430 characters.) If unspecified, defaults to the dimension | |
431 (this is almost always the correct value). | |
3025 | 432 `chars' Number of characters in each dimension (94 or 96). |
428 | 433 Defaults to 94. Note that if the dimension is 2, the |
434 character set thus described is 94x94 or 96x96. | |
3025 | 435 `final' Final byte of ISO 2022 escape sequence. Must be |
428 | 436 supplied. Each combination of (DIMENSION, CHARS) defines a |
437 separate namespace for final bytes. Note that ISO | |
438 2022 restricts the final byte to the range | |
439 0x30 - 0x7E if dimension == 1, and 0x30 - 0x5F if | |
440 dimension == 2. Note also that final bytes in the range | |
441 0x30 - 0x3F are reserved for user-defined (not official) | |
442 character sets. | |
3025 | 443 `graphic' 0 (use left half of font on output) or 1 (use right half |
428 | 444 of font on output). Defaults to 0. For example, for |
445 a font whose registry is ISO8859-1, the left half | |
446 (octets 0x20 - 0x7F) is the `ascii' character set, while | |
447 the right half (octets 0xA0 - 0xFF) is the `latin-1' | |
3025 | 448 character set. With `graphic' set to 0, the octets |
428 | 449 will have their high bit cleared; with it set to 1, |
450 the octets will have their high bit set. | |
3025 | 451 `direction' `l2r' (left-to-right) or `r2l' (right-to-left). |
452 Defaults to `l2r'. | |
453 `ccl-program' A compiled CCL program used to convert a character in | |
428 | 454 this charset into an index into the font. This is in |
3025 | 455 addition to the `graphic' property. The CCL program |
428 | 456 is passed the octets of the character, with the high |
457 bit cleared and set depending upon whether the value | |
3025 | 458 of the `graphic' property is 0 or 1. |
3439 | 459 `encode-as-utf-8' |
460 If non-nil, the charset will be written out using the UTF-8 | |
461 escape syntax in ISO 2022-oriented coding systems. Used for | |
462 supporting characters we know are part of Unicode but not of | |
463 any other known character set in escape-quoted and compound | |
464 text. | |
428 | 465 */ |
466 (name, doc_string, props)) | |
467 { | |
771 | 468 int id, dimension = 1, chars = 94, graphic = 0, columns = -1; |
867 | 469 Ibyte final = 0; |
428 | 470 int direction = CHARSET_LEFT_TO_RIGHT; |
471 int type; | |
3659 | 472 Lisp_Object registries = Qnil; |
771 | 473 Lisp_Object charset = Qnil; |
428 | 474 Lisp_Object ccl_program = Qnil; |
475 Lisp_Object short_name = Qnil, long_name = Qnil; | |
3439 | 476 int encode_as_utf_8 = 0; |
771 | 477 Lisp_Object existing_charset; |
478 int temporary = UNBOUNDP (name); | |
428 | 479 |
771 | 480 /* NOTE: name == Qunbound is a directive from the iso2022 code to |
481 create a temporary charset for an unknown final. We allow the final | |
482 to be overwritten with a real charset later on. */ | |
483 | |
428 | 484 if (!NILP (doc_string)) |
485 CHECK_STRING (doc_string); | |
771 | 486 if (!UNBOUNDP (name)) |
487 { | |
488 CHECK_SYMBOL (name); | |
428 | 489 |
771 | 490 charset = Ffind_charset (name); |
491 if (!NILP (charset)) | |
492 invalid_operation ("Cannot redefine existing charset", name); | |
493 } | |
428 | 494 |
442 | 495 { |
496 EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, props) | |
497 { | |
498 if (EQ (keyword, Qshort_name)) | |
499 { | |
500 CHECK_STRING (value); | |
501 short_name = value; | |
502 } | |
428 | 503 |
519 | 504 else if (EQ (keyword, Qlong_name)) |
442 | 505 { |
506 CHECK_STRING (value); | |
507 long_name = value; | |
508 } | |
428 | 509 |
442 | 510 else if (EQ (keyword, Qdimension)) |
511 { | |
512 CHECK_INT (value); | |
513 dimension = XINT (value); | |
514 if (dimension < 1 || dimension > 2) | |
3025 | 515 invalid_constant ("Invalid value for `dimension'", value); |
442 | 516 } |
428 | 517 |
442 | 518 else if (EQ (keyword, Qchars)) |
519 { | |
520 CHECK_INT (value); | |
521 chars = XINT (value); | |
522 if (chars != 94 && chars != 96) | |
3025 | 523 invalid_constant ("Invalid value for `chars'", value); |
442 | 524 } |
428 | 525 |
442 | 526 else if (EQ (keyword, Qcolumns)) |
527 { | |
528 CHECK_INT (value); | |
529 columns = XINT (value); | |
530 if (columns != 1 && columns != 2) | |
3025 | 531 invalid_constant ("Invalid value for `columns'", value); |
442 | 532 } |
428 | 533 |
442 | 534 else if (EQ (keyword, Qgraphic)) |
535 { | |
536 CHECK_INT (value); | |
537 graphic = XINT (value); | |
538 if (graphic < 0 || graphic > 1) | |
3025 | 539 invalid_constant ("Invalid value for `graphic'", value); |
442 | 540 } |
428 | 541 |
3659 | 542 else if (EQ (keyword, Qregistries)) |
543 { | |
544 CHECK_VECTOR (value); | |
545 registries = value; | |
546 } | |
547 | |
442 | 548 else if (EQ (keyword, Qregistry)) |
549 { | |
3659 | 550 Lisp_Object quoted_registry; |
551 | |
442 | 552 CHECK_STRING (value); |
3659 | 553 quoted_registry = Fregexp_quote(value); |
3662 | 554 if (qxestrcmp(XSTRING_DATA(quoted_registry), |
3659 | 555 XSTRING_DATA(value))) |
556 { | |
557 warn_when_safe | |
558 (Qregistry, Qwarning, | |
559 "Regexps no longer allowed for charset-registry. " | |
560 "Treating %s as string", XSTRING_DATA(value)); | |
561 } | |
562 registries = vector1(value); | |
442 | 563 } |
428 | 564 |
442 | 565 else if (EQ (keyword, Qdirection)) |
566 { | |
567 if (EQ (value, Ql2r)) | |
568 direction = CHARSET_LEFT_TO_RIGHT; | |
569 else if (EQ (value, Qr2l)) | |
570 direction = CHARSET_RIGHT_TO_LEFT; | |
571 else | |
3025 | 572 invalid_constant ("Invalid value for `direction'", value); |
442 | 573 } |
428 | 574 |
3439 | 575 else if (EQ (keyword, Qencode_as_utf_8)) |
576 { | |
577 encode_as_utf_8 = NILP (value) ? 0 : 1; | |
578 } | |
579 | |
442 | 580 else if (EQ (keyword, Qfinal)) |
581 { | |
582 CHECK_CHAR_COERCE_INT (value); | |
583 final = XCHAR (value); | |
584 if (final < '0' || final > '~') | |
3025 | 585 invalid_constant ("Invalid value for `final'", value); |
442 | 586 } |
587 else if (EQ (keyword, Qccl_program)) | |
588 { | |
4745
0c54de4c4b9d
Resolve the unregistered-CCL-programs-get-garbage-collected problem correctly
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
589 /* This errors if VALUE is not a valid CCL program. */ |
0c54de4c4b9d
Resolve the unregistered-CCL-programs-get-garbage-collected problem correctly
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
590 ccl_program = get_ccl_program (value); |
442 | 591 } |
592 else | |
563 | 593 invalid_constant ("Unrecognized property", keyword); |
442 | 594 } |
595 } | |
428 | 596 |
597 if (!final) | |
3025 | 598 invalid_argument ("`final' must be specified", Qunbound); |
428 | 599 if (dimension == 2 && final > 0x5F) |
563 | 600 invalid_constant |
428 | 601 ("Final must be in the range 0x30 - 0x5F for dimension == 2", |
602 make_char (final)); | |
603 | |
604 if (dimension == 1) | |
605 type = (chars == 94) ? CHARSET_TYPE_94 : CHARSET_TYPE_96; | |
606 else | |
607 type = (chars == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96; | |
608 | |
826 | 609 existing_charset = charset_by_attributes (type, final, direction); |
771 | 610 |
611 if (!NILP (existing_charset) && !XCHARSET (existing_charset)->temporary) | |
578 | 612 invalid_argument |
793 | 613 ("Character set already defined for this DIMENSION/CHARS/FINAL/DIRECTION combo", |
771 | 614 existing_charset); |
615 | |
616 if (!NILP (existing_charset)) | |
617 /* Reuse same leading byte */ | |
618 id = XCHARSET_ID (existing_charset); | |
619 else | |
620 id = get_unallocated_leading_byte (dimension); | |
428 | 621 |
771 | 622 if (temporary) |
623 { | |
867 | 624 Ibyte tempname[80]; |
428 | 625 |
771 | 626 qxesprintf (tempname, "___temporary___%d__", id); |
4953
304aebb79cd3
function renamings to track names of char typedefs
Ben Wing <ben@xemacs.org>
parents:
4952
diff
changeset
|
627 name = Fmake_symbol (build_istring (tempname)); /* Uninterned. */ |
771 | 628 } |
428 | 629 if (NILP (doc_string)) |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
630 doc_string = build_ascstring (""); |
3659 | 631 if (NILP (registries)) |
632 registries = make_vector(0, Qnil); | |
428 | 633 if (NILP (short_name)) |
793 | 634 short_name = XSYMBOL (name)->name; |
428 | 635 if (NILP (long_name)) |
636 long_name = doc_string; | |
637 if (columns == -1) | |
638 columns = dimension; | |
771 | 639 |
428 | 640 charset = make_charset (id, name, dimension + 2, type, columns, graphic, |
771 | 641 final, direction, short_name, long_name, |
3659 | 642 doc_string, registries, !NILP (existing_charset), |
3439 | 643 encode_as_utf_8); |
771 | 644 |
645 XCHARSET (charset)->temporary = temporary; | |
428 | 646 if (!NILP (ccl_program)) |
647 XCHARSET_CCL_PROGRAM (charset) = ccl_program; | |
771 | 648 |
793 | 649 { |
650 Lisp_Object revdircs = | |
826 | 651 charset_by_attributes (type, final, |
793 | 652 direction == CHARSET_LEFT_TO_RIGHT ? |
653 CHARSET_RIGHT_TO_LEFT : CHARSET_LEFT_TO_RIGHT); | |
654 if (!NILP (revdircs)) | |
655 { | |
656 XCHARSET_REVERSE_DIRECTION_CHARSET (revdircs) = charset; | |
657 XCHARSET_REVERSE_DIRECTION_CHARSET (charset) = revdircs; | |
658 } | |
659 } | |
660 | |
428 | 661 return charset; |
662 } | |
663 | |
664 DEFUN ("make-reverse-direction-charset", Fmake_reverse_direction_charset, | |
665 2, 2, 0, /* | |
666 Make a charset equivalent to CHARSET but which goes in the opposite direction. | |
667 NEW-NAME is the name of the new charset. Return the new charset. | |
668 */ | |
669 (charset, new_name)) | |
670 { | |
671 Lisp_Object new_charset = Qnil; | |
3439 | 672 int id, dimension, columns, graphic, encode_as_utf_8; |
867 | 673 Ibyte final; |
428 | 674 int direction, type; |
3659 | 675 Lisp_Object registries, doc_string, short_name, long_name; |
440 | 676 Lisp_Charset *cs; |
428 | 677 |
678 charset = Fget_charset (charset); | |
679 if (!NILP (XCHARSET_REVERSE_DIRECTION_CHARSET (charset))) | |
563 | 680 invalid_operation ("Charset already has reverse-direction charset", |
793 | 681 charset); |
428 | 682 |
683 CHECK_SYMBOL (new_name); | |
684 if (!NILP (Ffind_charset (new_name))) | |
563 | 685 invalid_operation ("Cannot redefine existing charset", new_name); |
428 | 686 |
687 cs = XCHARSET (charset); | |
688 | |
689 type = CHARSET_TYPE (cs); | |
690 columns = CHARSET_COLUMNS (cs); | |
691 dimension = CHARSET_DIMENSION (cs); | |
692 id = get_unallocated_leading_byte (dimension); | |
693 | |
694 graphic = CHARSET_GRAPHIC (cs); | |
695 final = CHARSET_FINAL (cs); | |
696 direction = CHARSET_RIGHT_TO_LEFT; | |
697 if (CHARSET_DIRECTION (cs) == CHARSET_RIGHT_TO_LEFT) | |
698 direction = CHARSET_LEFT_TO_RIGHT; | |
699 doc_string = CHARSET_DOC_STRING (cs); | |
700 short_name = CHARSET_SHORT_NAME (cs); | |
701 long_name = CHARSET_LONG_NAME (cs); | |
3659 | 702 registries = CHARSET_REGISTRIES (cs); |
3439 | 703 encode_as_utf_8 = CHARSET_ENCODE_AS_UTF_8 (cs); |
428 | 704 |
705 new_charset = make_charset (id, new_name, dimension + 2, type, columns, | |
706 graphic, final, direction, short_name, long_name, | |
3659 | 707 doc_string, registries, 0, encode_as_utf_8); |
428 | 708 |
709 CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset; | |
710 XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset; | |
711 | |
712 return new_charset; | |
713 } | |
714 | |
715 DEFUN ("charset-reverse-direction-charset", Fcharset_reverse_direction_charset, | |
716 1, 1, 0, /* | |
717 Return the reverse-direction charset parallel to CHARSET, if any. | |
718 This is the charset with the same properties (in particular, the same | |
719 dimension, number of characters per dimension, and final byte) as | |
720 CHARSET but whose characters are displayed in the opposite direction. | |
721 */ | |
722 (charset)) | |
723 { | |
724 charset = Fget_charset (charset); | |
725 return XCHARSET_REVERSE_DIRECTION_CHARSET (charset); | |
726 } | |
727 | |
728 DEFUN ("charset-from-attributes", Fcharset_from_attributes, 3, 4, 0, /* | |
729 Return a charset with the given DIMENSION, CHARS, FINAL, and DIRECTION. | |
730 If DIRECTION is omitted, both directions will be checked (left-to-right | |
731 will be returned if character sets exist for both directions). | |
732 */ | |
733 (dimension, chars, final, direction)) | |
734 { | |
735 int dm, ch, fi, di = -1; | |
736 int type; | |
737 Lisp_Object obj = Qnil; | |
738 | |
739 CHECK_INT (dimension); | |
740 dm = XINT (dimension); | |
741 if (dm < 1 || dm > 2) | |
563 | 742 invalid_constant ("Invalid value for DIMENSION", dimension); |
428 | 743 |
744 CHECK_INT (chars); | |
745 ch = XINT (chars); | |
746 if (ch != 94 && ch != 96) | |
563 | 747 invalid_constant ("Invalid value for CHARS", chars); |
428 | 748 |
749 CHECK_CHAR_COERCE_INT (final); | |
750 fi = XCHAR (final); | |
751 if (fi < '0' || fi > '~') | |
563 | 752 invalid_constant ("Invalid value for FINAL", final); |
428 | 753 |
754 if (EQ (direction, Ql2r)) | |
755 di = CHARSET_LEFT_TO_RIGHT; | |
756 else if (EQ (direction, Qr2l)) | |
757 di = CHARSET_RIGHT_TO_LEFT; | |
758 else if (!NILP (direction)) | |
563 | 759 invalid_constant ("Invalid value for DIRECTION", direction); |
428 | 760 |
761 if (dm == 2 && fi > 0x5F) | |
563 | 762 invalid_constant |
428 | 763 ("Final must be in the range 0x30 - 0x5F for dimension == 2", final); |
764 | |
765 if (dm == 1) | |
766 type = (ch == 94) ? CHARSET_TYPE_94 : CHARSET_TYPE_96; | |
767 else | |
768 type = (ch == 94) ? CHARSET_TYPE_94X94 : CHARSET_TYPE_96X96; | |
769 | |
770 if (di == -1) | |
771 { | |
826 | 772 obj = charset_by_attributes (type, fi, CHARSET_LEFT_TO_RIGHT); |
428 | 773 if (NILP (obj)) |
826 | 774 obj = charset_by_attributes (type, fi, CHARSET_RIGHT_TO_LEFT); |
428 | 775 } |
776 else | |
826 | 777 obj = charset_by_attributes (type, fi, di); |
428 | 778 |
779 if (CHARSETP (obj)) | |
780 return XCHARSET_NAME (obj); | |
781 return obj; | |
782 } | |
783 | |
784 DEFUN ("charset-short-name", Fcharset_short_name, 1, 1, 0, /* | |
785 Return short name of CHARSET. | |
786 */ | |
787 (charset)) | |
788 { | |
789 return XCHARSET_SHORT_NAME (Fget_charset (charset)); | |
790 } | |
791 | |
792 DEFUN ("charset-long-name", Fcharset_long_name, 1, 1, 0, /* | |
793 Return long name of CHARSET. | |
794 */ | |
795 (charset)) | |
796 { | |
797 return XCHARSET_LONG_NAME (Fget_charset (charset)); | |
798 } | |
799 | |
800 DEFUN ("charset-description", Fcharset_description, 1, 1, 0, /* | |
801 Return description of CHARSET. | |
802 */ | |
803 (charset)) | |
804 { | |
805 return XCHARSET_DOC_STRING (Fget_charset (charset)); | |
806 } | |
807 | |
808 DEFUN ("charset-dimension", Fcharset_dimension, 1, 1, 0, /* | |
809 Return dimension of CHARSET. | |
810 */ | |
811 (charset)) | |
812 { | |
813 return make_int (XCHARSET_DIMENSION (Fget_charset (charset))); | |
814 } | |
815 | |
816 DEFUN ("charset-property", Fcharset_property, 2, 2, 0, /* | |
446 | 817 Return property PROP of CHARSET, a charset object or symbol naming a charset. |
428 | 818 Recognized properties are those listed in `make-charset', as well as |
3025 | 819 `name' and `doc-string'. |
428 | 820 */ |
821 (charset, prop)) | |
822 { | |
440 | 823 Lisp_Charset *cs; |
428 | 824 |
825 charset = Fget_charset (charset); | |
826 cs = XCHARSET (charset); | |
827 | |
828 CHECK_SYMBOL (prop); | |
829 if (EQ (prop, Qname)) return CHARSET_NAME (cs); | |
830 if (EQ (prop, Qshort_name)) return CHARSET_SHORT_NAME (cs); | |
831 if (EQ (prop, Qlong_name)) return CHARSET_LONG_NAME (cs); | |
832 if (EQ (prop, Qdoc_string)) return CHARSET_DOC_STRING (cs); | |
833 if (EQ (prop, Qdimension)) return make_int (CHARSET_DIMENSION (cs)); | |
834 if (EQ (prop, Qcolumns)) return make_int (CHARSET_COLUMNS (cs)); | |
835 if (EQ (prop, Qgraphic)) return make_int (CHARSET_GRAPHIC (cs)); | |
836 if (EQ (prop, Qfinal)) return make_char (CHARSET_FINAL (cs)); | |
837 if (EQ (prop, Qchars)) return make_int (CHARSET_CHARS (cs)); | |
3659 | 838 if (EQ (prop, Qregistries)) return CHARSET_REGISTRIES (cs); |
3439 | 839 if (EQ (prop, Qencode_as_utf_8)) |
840 return CHARSET_ENCODE_AS_UTF_8 (cs) ? Qt : Qnil; | |
428 | 841 if (EQ (prop, Qccl_program)) return CHARSET_CCL_PROGRAM (cs); |
842 if (EQ (prop, Qdirection)) | |
843 return CHARSET_DIRECTION (cs) == CHARSET_LEFT_TO_RIGHT ? Ql2r : Qr2l; | |
844 if (EQ (prop, Qreverse_direction_charset)) | |
845 { | |
846 Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs); | |
446 | 847 /* #### Is this translation OK? If so, error checking sufficient? */ |
848 return CHARSETP (obj) ? XCHARSET_NAME (obj) : obj; | |
428 | 849 } |
563 | 850 invalid_constant ("Unrecognized charset property name", prop); |
1204 | 851 RETURN_NOT_REACHED (Qnil); |
428 | 852 } |
853 | |
854 DEFUN ("charset-id", Fcharset_id, 1, 1, 0, /* | |
855 Return charset identification number of CHARSET. | |
856 */ | |
857 (charset)) | |
858 { | |
793 | 859 return make_int (XCHARSET_LEADING_BYTE (Fget_charset (charset))); |
428 | 860 } |
861 | |
862 /* #### We need to figure out which properties we really want to | |
863 allow to be set. */ | |
864 | |
865 DEFUN ("set-charset-ccl-program", Fset_charset_ccl_program, 2, 2, 0, /* | |
3025 | 866 Set the `ccl-program' property of CHARSET to CCL-PROGRAM. |
428 | 867 */ |
868 (charset, ccl_program)) | |
869 { | |
870 charset = Fget_charset (charset); | |
4745
0c54de4c4b9d
Resolve the unregistered-CCL-programs-get-garbage-collected problem correctly
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
871 XCHARSET_CCL_PROGRAM (charset) = get_ccl_program (ccl_program); |
0c54de4c4b9d
Resolve the unregistered-CCL-programs-get-garbage-collected problem correctly
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
872 |
510 | 873 face_property_was_changed (Vdefault_face, Qfont, Qglobal); |
428 | 874 return Qnil; |
875 } | |
876 | |
3676 | 877 void |
878 set_charset_registries(Lisp_Object charset, Lisp_Object registries) | |
879 { | |
880 XCHARSET_REGISTRIES (charset) = registries; | |
881 invalidate_charset_font_caches (charset); | |
882 face_property_was_changed (Vdefault_face, Qfont, Qglobal); | |
883 } | |
884 | |
3711 | 885 DEFUN ("set-charset-registries", Fset_charset_registries, 2, 3, 0, /* |
3659 | 886 Set the `registries' property of CHARSET to REGISTRIES. |
887 | |
888 REGISTRIES is an ordered vector of strings that describe the X11 | |
889 CHARSET_REGISTRY and the CHARSET_ENCODINGs appropriate for this charset. | |
890 Separate each registry from the corresponding encoding with a dash. The | |
891 strings are not regular expressions, in contrast to the old behavior of | |
892 the `charset-registry' property. | |
893 | |
894 One reason to call this function might be if you're in Japan and you'd | |
895 prefer the backslash to display as a Yen sign; the corresponding syntax | |
896 would be: | |
897 | |
898 (set-charset-registries 'ascii ["jisx0201.1976-0"]) | |
899 | |
3711 | 900 If optional argument FORCE is non-nil, avoid sanity-checking the elements of |
901 REGISTRIES. Normally the strings are checked to make sure they contain no | |
902 XLFD wild cards and that they contain at least one hyphen; the only context | |
903 in which one might want not to do this is in order to use a font which | |
904 doesn't have a full XLFD--and thus, an effective | |
905 CHARSET_REGISTRY-CHARSET_ENCODING of ""--to display ASCII. | |
906 | |
907 We recommend strongly that you specify a full XLFD, since this makes | |
908 multilingual and variant font handling work much better. To get the full | |
909 XLFD of any font, start xfd with the short name as the pattern argument: | |
910 | |
911 xfd -fn 8x16kana | |
912 | |
913 and use the text that appears at the top of the window. | |
428 | 914 */ |
3711 | 915 (charset, registries, force)) |
428 | 916 { |
3659 | 917 int i; |
428 | 918 charset = Fget_charset (charset); |
3659 | 919 CHECK_VECTOR (registries); |
920 | |
921 for (i = 0; i < XVECTOR_LENGTH(registries); ++i) | |
922 { | |
923 CHECK_STRING (XVECTOR_DATA(registries)[i]); | |
3711 | 924 |
925 if (!NILP(force)) | |
926 { | |
927 continue; | |
928 } | |
929 | |
3659 | 930 if (NULL == qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '-')) |
931 { | |
932 invalid_argument("Not an X11 REGISTRY-ENCODING combination", | |
933 XVECTOR_DATA(registries)[i]); | |
934 } | |
3676 | 935 |
936 if (qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '*') || | |
937 qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '?')) | |
938 { | |
939 invalid_argument | |
940 ("XLFD wildcards not allowed in charset-registries", | |
941 XVECTOR_DATA(registries)[i]); | |
942 | |
943 } | |
3659 | 944 } |
945 | |
3676 | 946 set_charset_registries(charset, registries); |
947 | |
428 | 948 return Qnil; |
949 } | |
950 | |
3681 | 951 DEFUN ("charsets-in-region", Fcharsets_in_region, 2, 3, 0, /* |
952 Return a list of the charsets in the region between START and END. | |
953 BUFFER defaults to the current buffer if omitted. | |
954 */ | |
955 (start, end, buffer)) | |
956 { | |
957 /* This function can GC */ | |
958 struct buffer *buf = decode_buffer (buffer, 1); | |
959 Charbpos pos, stop; /* Limits of the region. */ | |
960 Lisp_Object res = Qnil; | |
961 int charsets[NUM_LEADING_BYTES]; | |
962 Ibyte lb; | |
963 struct gcpro gcpro1; | |
964 | |
965 memset(charsets, 0, sizeof(charsets)); | |
966 get_buffer_range_char (buf, start, end, &pos, &stop, 0); | |
967 | |
968 GCPRO1 (res); | |
969 while (pos < stop) | |
970 { | |
971 lb = ichar_leading_byte(BUF_FETCH_CHAR (buf, pos)); | |
972 if (0 == charsets[lb - MIN_LEADING_BYTE]) | |
973 { | |
974 charsets[lb - MIN_LEADING_BYTE] = 1; | |
975 res = Fcons (XCHARSET_NAME(charset_by_leading_byte(lb)), res); | |
976 } | |
977 ++pos; | |
978 } | |
979 UNGCPRO; | |
980 | |
981 return res; | |
982 } | |
983 | |
428 | 984 |
985 /************************************************************************/ | |
771 | 986 /* memory usage */ |
428 | 987 /************************************************************************/ |
988 | |
771 | 989 #ifdef MEMORY_USAGE_STATS |
428 | 990 |
771 | 991 struct charset_stats |
992 { | |
993 int from_unicode; | |
994 int to_unicode; | |
995 int other; | |
996 }; | |
428 | 997 |
771 | 998 static void |
999 compute_charset_usage (Lisp_Object charset, struct charset_stats *stats, | |
1000 struct overhead_stats *ovstats) | |
428 | 1001 { |
771 | 1002 xzero (*stats); |
5127
a9c41067dd88
more cleanups, terminology clarification, lots of doc work
Ben Wing <ben@xemacs.org>
parents:
5125
diff
changeset
|
1003 stats->other += lisp_object_storage_size (charset, ovstats); |
771 | 1004 stats->from_unicode += compute_from_unicode_table_size (charset, ovstats); |
1005 stats->to_unicode += compute_to_unicode_table_size (charset, ovstats); | |
438 | 1006 } |
1007 | |
771 | 1008 DEFUN ("charset-memory-usage", Fcharset_memory_usage, 1, 1, 0, /* |
1009 Return stats about the memory usage of charset CHARSET. | |
1010 The values returned are in the form of an alist of usage types and | |
1011 byte counts. The byte counts attempt to encompass all the memory used | |
1012 by the charset (separate from the memory logically associated with a | |
1013 charset or frame), including internal structures and any malloc() | |
1014 overhead associated with them. In practice, the byte counts are | |
1015 underestimated for various reasons, e.g. because certain memory usage | |
1016 is very hard to determine \(e.g. the amount of memory used inside the | |
1017 Xt library or inside the X server). | |
428 | 1018 |
771 | 1019 Multiple slices of the total memory usage may be returned, separated |
1020 by a nil. Each slice represents a particular view of the memory, a | |
1021 particular way of partitioning it into groups. Within a slice, there | |
1022 is no overlap between the groups of memory, and each slice collectively | |
1023 represents all the memory concerned. | |
1024 */ | |
1025 (charset)) | |
1026 { | |
1027 struct charset_stats stats; | |
1028 struct overhead_stats ovstats; | |
1029 Lisp_Object val = Qnil; | |
428 | 1030 |
771 | 1031 charset = Fget_charset (charset); |
1032 xzero (ovstats); | |
1033 compute_charset_usage (charset, &stats, &ovstats); | |
428 | 1034 |
771 | 1035 val = acons (Qfrom_unicode, make_int (stats.from_unicode), val); |
1036 val = acons (Qto_unicode, make_int (stats.to_unicode), val); | |
1037 val = Fcons (Qnil, val); | |
1038 val = acons (Qactually_requested, make_int (ovstats.was_requested), val); | |
1039 val = acons (Qmalloc_overhead, make_int (ovstats.malloc_overhead), val); | |
1040 val = acons (Qgap_overhead, make_int (ovstats.gap_overhead), val); | |
1041 val = acons (Qdynarr_overhead, make_int (ovstats.dynarr_overhead), val); | |
1042 | |
1043 return Fnreverse (val); | |
428 | 1044 } |
1045 | |
771 | 1046 #endif /* MEMORY_USAGE_STATS */ |
428 | 1047 |
1048 | |
1049 /************************************************************************/ | |
1050 /* initialization */ | |
1051 /************************************************************************/ | |
1052 | |
1053 void | |
1054 syms_of_mule_charset (void) | |
1055 { | |
5117
3742ea8250b5
Checking in final CVS version of workspace 'ben-lisp-object'
Ben Wing <ben@xemacs.org>
parents:
3025
diff
changeset
|
1056 INIT_LISP_OBJECT (charset); |
442 | 1057 |
428 | 1058 DEFSUBR (Fcharsetp); |
1059 DEFSUBR (Ffind_charset); | |
1060 DEFSUBR (Fget_charset); | |
1061 DEFSUBR (Fcharset_list); | |
1062 DEFSUBR (Fcharset_name); | |
1063 DEFSUBR (Fmake_charset); | |
1064 DEFSUBR (Fmake_reverse_direction_charset); | |
793 | 1065 DEFSUBR (Fcharset_reverse_direction_charset); |
428 | 1066 DEFSUBR (Fcharset_from_attributes); |
1067 DEFSUBR (Fcharset_short_name); | |
1068 DEFSUBR (Fcharset_long_name); | |
1069 DEFSUBR (Fcharset_description); | |
1070 DEFSUBR (Fcharset_dimension); | |
1071 DEFSUBR (Fcharset_property); | |
1072 DEFSUBR (Fcharset_id); | |
1073 DEFSUBR (Fset_charset_ccl_program); | |
3659 | 1074 DEFSUBR (Fset_charset_registries); |
3681 | 1075 DEFSUBR (Fcharsets_in_region); |
428 | 1076 |
771 | 1077 #ifdef MEMORY_USAGE_STATS |
1078 DEFSUBR (Fcharset_memory_usage); | |
428 | 1079 #endif |
1080 | |
563 | 1081 DEFSYMBOL (Qcharsetp); |
3659 | 1082 DEFSYMBOL (Qregistries); |
563 | 1083 DEFSYMBOL (Qfinal); |
1084 DEFSYMBOL (Qgraphic); | |
3659 | 1085 DEFSYMBOL (Qregistry); |
563 | 1086 DEFSYMBOL (Qdirection); |
1087 DEFSYMBOL (Qreverse_direction_charset); | |
1088 DEFSYMBOL (Qshort_name); | |
1089 DEFSYMBOL (Qlong_name); | |
428 | 1090 |
771 | 1091 DEFSYMBOL (Qto_unicode); |
1092 | |
563 | 1093 DEFSYMBOL (Ql2r); |
1094 DEFSYMBOL (Qr2l); | |
428 | 1095 |
1096 /* Charsets, compatible with FSF 20.3 | |
1097 Naming convention is Script-Charset[-Edition] */ | |
563 | 1098 DEFSYMBOL (Qlatin_iso8859_1); |
1099 DEFSYMBOL (Qlatin_iso8859_2); | |
1100 DEFSYMBOL (Qlatin_iso8859_3); | |
1101 DEFSYMBOL (Qlatin_iso8859_4); | |
1102 DEFSYMBOL (Qthai_tis620); | |
1103 DEFSYMBOL (Qgreek_iso8859_7); | |
4805
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1104 DEFSYMBOL (Qarabic_iso8859_6); |
563 | 1105 DEFSYMBOL (Qhebrew_iso8859_8); |
1106 DEFSYMBOL (Qkatakana_jisx0201); | |
1107 DEFSYMBOL (Qlatin_jisx0201); | |
1108 DEFSYMBOL (Qcyrillic_iso8859_5); | |
1109 DEFSYMBOL (Qlatin_iso8859_9); | |
728 | 1110 DEFSYMBOL (Qlatin_iso8859_15); |
563 | 1111 DEFSYMBOL (Qjapanese_jisx0208_1978); |
1112 DEFSYMBOL (Qchinese_gb2312); | |
1113 DEFSYMBOL (Qjapanese_jisx0208); | |
1114 DEFSYMBOL (Qkorean_ksc5601); | |
1115 DEFSYMBOL (Qjapanese_jisx0212); | |
1116 DEFSYMBOL (Qchinese_cns11643_1); | |
1117 DEFSYMBOL (Qchinese_cns11643_2); | |
1118 DEFSYMBOL (Qchinese_big5_1); | |
1119 DEFSYMBOL (Qchinese_big5_2); | |
428 | 1120 |
563 | 1121 DEFSYMBOL (Qcomposite); |
428 | 1122 } |
1123 | |
1124 void | |
1125 vars_of_mule_charset (void) | |
1126 { | |
1127 int i, j, k; | |
1128 | |
452 | 1129 chlook = xnew_and_zero (struct charset_lookup); /* zero for Purify. */ |
2367 | 1130 dump_add_root_block_ptr (&chlook, &charset_lookup_description); |
428 | 1131 |
1132 /* Table of charsets indexed by leading byte. */ | |
1133 for (i = 0; i < countof (chlook->charset_by_leading_byte); i++) | |
1134 chlook->charset_by_leading_byte[i] = Qnil; | |
1135 | |
1136 /* Table of charsets indexed by type/final-byte/direction. */ | |
1137 for (i = 0; i < countof (chlook->charset_by_attributes); i++) | |
1138 for (j = 0; j < countof (chlook->charset_by_attributes[0]); j++) | |
1139 for (k = 0; k < countof (chlook->charset_by_attributes[0][0]); k++) | |
1140 chlook->charset_by_attributes[i][j][k] = Qnil; | |
1141 | |
442 | 1142 chlook->next_allocated_1_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_1; |
1143 chlook->next_allocated_2_byte_leading_byte = MIN_LEADING_BYTE_PRIVATE_2; | |
771 | 1144 |
1145 staticpro (&Vcharset_hash_table); | |
1146 Vcharset_hash_table = | |
1147 make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); | |
428 | 1148 } |
1149 | |
1150 void | |
1151 complex_vars_of_mule_charset (void) | |
1152 { | |
1153 /* Predefined character sets. We store them into variables for | |
1154 ease of access. */ | |
1155 | |
1156 staticpro (&Vcharset_ascii); | |
1157 Vcharset_ascii = | |
1158 make_charset (LEADING_BYTE_ASCII, Qascii, 1, | |
1159 CHARSET_TYPE_94, 1, 0, 'B', | |
1160 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1161 build_ascstring ("ASCII"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1162 build_defer_string ("ASCII"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1163 build_defer_string ("ASCII (ISO646 IRV)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1164 vector1(build_ascstring("iso8859-1")), 0, 0); |
428 | 1165 staticpro (&Vcharset_control_1); |
1166 Vcharset_control_1 = | |
1167 make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, 2, | |
1168 CHARSET_TYPE_94, 1, 1, 0, | |
1169 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1170 build_ascstring ("C1"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1171 build_defer_string ("Control characters"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1172 build_defer_string ("Control characters 128-191"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1173 vector1(build_ascstring("iso8859-1")), 0, 0); |
428 | 1174 staticpro (&Vcharset_latin_iso8859_1); |
1175 Vcharset_latin_iso8859_1 = | |
1176 make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1, 2, | |
1177 CHARSET_TYPE_96, 1, 1, 'A', | |
1178 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1179 build_ascstring ("Latin-1"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1180 build_defer_string ("ISO8859-1 (Latin-1)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1181 build_defer_string ("ISO8859-1 (Latin-1)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1182 vector1(build_ascstring("iso8859-1")), 0, 0); |
428 | 1183 staticpro (&Vcharset_latin_iso8859_2); |
1184 Vcharset_latin_iso8859_2 = | |
1185 make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2, 2, | |
1186 CHARSET_TYPE_96, 1, 1, 'B', | |
1187 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1188 build_ascstring ("Latin-2"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1189 build_defer_string ("ISO8859-2 (Latin-2)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1190 build_defer_string ("ISO8859-2 (Latin-2)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1191 vector1(build_ascstring("iso8859-2")), 0, 0); |
428 | 1192 staticpro (&Vcharset_latin_iso8859_3); |
1193 Vcharset_latin_iso8859_3 = | |
1194 make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3, 2, | |
1195 CHARSET_TYPE_96, 1, 1, 'C', | |
1196 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1197 build_ascstring ("Latin-3"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1198 build_defer_string ("ISO8859-3 (Latin-3)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1199 build_defer_string ("ISO8859-3 (Latin-3)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1200 vector1(build_ascstring("iso8859-3")), 0, 0); |
428 | 1201 staticpro (&Vcharset_latin_iso8859_4); |
1202 Vcharset_latin_iso8859_4 = | |
1203 make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4, 2, | |
1204 CHARSET_TYPE_96, 1, 1, 'D', | |
1205 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1206 build_ascstring ("Latin-4"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1207 build_defer_string ("ISO8859-4 (Latin-4)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1208 build_defer_string ("ISO8859-4 (Latin-4)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1209 vector1(build_ascstring("iso8859-4")), 0, 0); |
428 | 1210 staticpro (&Vcharset_thai_tis620); |
1211 Vcharset_thai_tis620 = | |
1212 make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620, 2, | |
1213 CHARSET_TYPE_96, 1, 1, 'T', | |
1214 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1215 build_ascstring ("TIS620"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1216 build_defer_string ("TIS620 (Thai)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1217 build_defer_string ("TIS620.2529 (Thai)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1218 vector1(build_ascstring("tis620.2529-1")), 0, 0); |
428 | 1219 staticpro (&Vcharset_greek_iso8859_7); |
1220 Vcharset_greek_iso8859_7 = | |
1221 make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7, 2, | |
1222 CHARSET_TYPE_96, 1, 1, 'F', | |
1223 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1224 build_ascstring ("ISO8859-7"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1225 build_defer_string ("ISO8859-7 (Greek)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1226 build_defer_string ("ISO8859-7 (Greek)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1227 vector1(build_ascstring("iso8859-7")), 0, 0); |
4805
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1228 staticpro (&Vcharset_arabic_iso8859_6); |
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1229 Vcharset_arabic_iso8859_6 = |
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1230 make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, 2, |
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1231 CHARSET_TYPE_96, 1, 1, 'G', |
980575c76541
Move the arabic-iso8859-6 character set back to C, otherwise X11 lookup fails.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4745
diff
changeset
|
1232 CHARSET_RIGHT_TO_LEFT, |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1233 build_ascstring ("ISO8859-6"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1234 build_defer_string ("ISO8859-6 (Arabic)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1235 build_defer_string ("ISO8859-6 (Arabic)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1236 vector1(build_ascstring ("iso8859-6")), 0, 0); |
428 | 1237 staticpro (&Vcharset_hebrew_iso8859_8); |
1238 Vcharset_hebrew_iso8859_8 = | |
1239 make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, 2, | |
1240 CHARSET_TYPE_96, 1, 1, 'H', | |
1241 CHARSET_RIGHT_TO_LEFT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1242 build_ascstring ("ISO8859-8"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1243 build_defer_string ("ISO8859-8 (Hebrew)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1244 build_defer_string ("ISO8859-8 (Hebrew)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1245 vector1(build_ascstring ("iso8859-8")), 0, 0); |
428 | 1246 staticpro (&Vcharset_katakana_jisx0201); |
1247 Vcharset_katakana_jisx0201 = | |
1248 make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, 2, | |
1249 CHARSET_TYPE_94, 1, 1, 'I', | |
1250 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1251 build_ascstring ("JISX0201 Kana"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1252 build_defer_string ("JISX0201.1976 (Japanese Kana)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1253 build_defer_string ("JISX0201.1976 Japanese Kana"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1254 vector1(build_ascstring ("jisx0201.1976-0")), 0, 0); |
428 | 1255 staticpro (&Vcharset_latin_jisx0201); |
1256 Vcharset_latin_jisx0201 = | |
1257 make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, 2, | |
1258 CHARSET_TYPE_94, 1, 0, 'J', | |
1259 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1260 build_ascstring ("JISX0201 Roman"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1261 build_defer_string ("JISX0201.1976 (Japanese Roman)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1262 build_defer_string ("JISX0201.1976 Japanese Roman"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1263 vector1(build_ascstring ("jisx0201.1976-0")), 0, 0); |
428 | 1264 staticpro (&Vcharset_cyrillic_iso8859_5); |
1265 Vcharset_cyrillic_iso8859_5 = | |
1266 make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5, 2, | |
1267 CHARSET_TYPE_96, 1, 1, 'L', | |
1268 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1269 build_ascstring ("ISO8859-5"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1270 build_defer_string ("ISO8859-5 (Cyrillic)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1271 build_defer_string ("ISO8859-5 (Cyrillic)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1272 vector1(build_ascstring ("iso8859-5")), 0, 0); |
428 | 1273 staticpro (&Vcharset_latin_iso8859_9); |
1274 Vcharset_latin_iso8859_9 = | |
1275 make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9, 2, | |
1276 CHARSET_TYPE_96, 1, 1, 'M', | |
1277 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1278 build_ascstring ("Latin-5"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1279 build_defer_string ("ISO8859-9 (Latin-5)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1280 build_defer_string ("ISO8859-9 (Latin-5)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1281 vector1(build_ascstring ("iso8859-9")), 0, 0); |
728 | 1282 staticpro (&Vcharset_latin_iso8859_15); |
1283 Vcharset_latin_iso8859_15 = | |
1284 make_charset (LEADING_BYTE_LATIN_ISO8859_15, Qlatin_iso8859_15, 2, | |
1285 CHARSET_TYPE_96, 1, 1, 'b', | |
1286 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1287 build_ascstring ("Latin-9"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1288 build_defer_string ("ISO8859-15 (Latin-9)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1289 build_defer_string ("ISO8859-15 (Latin-9)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1290 vector1(build_ascstring ("iso8859-15")), 0, 0); |
428 | 1291 staticpro (&Vcharset_japanese_jisx0208_1978); |
1292 Vcharset_japanese_jisx0208_1978 = | |
1293 make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, 3, | |
1294 CHARSET_TYPE_94X94, 2, 0, '@', | |
1295 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1296 build_ascstring ("JISX0208.1978"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1297 build_defer_string ("JISX0208.1978 (Japanese)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1298 build_defer_string |
428 | 1299 ("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1300 vector2(build_ascstring("jisx0208.1978-0"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1301 build_ascstring("jisc6226.1978-0")), 0, 0); |
428 | 1302 staticpro (&Vcharset_chinese_gb2312); |
1303 Vcharset_chinese_gb2312 = | |
1304 make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, 3, | |
1305 CHARSET_TYPE_94X94, 2, 0, 'A', | |
1306 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1307 build_ascstring ("GB2312"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1308 build_defer_string ("GB2312)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1309 build_defer_string ("GB2312 Chinese simplified"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1310 vector2(build_ascstring("gb2312.1980-0"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1311 build_ascstring("gb2312.80&gb8565.88-0")), 0, 0); |
428 | 1312 staticpro (&Vcharset_japanese_jisx0208); |
1313 Vcharset_japanese_jisx0208 = | |
1314 make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, 3, | |
1315 CHARSET_TYPE_94X94, 2, 0, 'B', | |
1316 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1317 build_ascstring ("JISX0208"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1318 build_defer_string ("JISX0208.1983/1990 (Japanese)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1319 build_defer_string ("JISX0208.1983/1990 Japanese Kanji"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1320 vector2(build_ascstring("jisx0208.1983-0"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1321 build_ascstring("jisx0208.1990-0")), 0, 0); |
428 | 1322 staticpro (&Vcharset_korean_ksc5601); |
1323 Vcharset_korean_ksc5601 = | |
1324 make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601, 3, | |
1325 CHARSET_TYPE_94X94, 2, 0, 'C', | |
1326 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1327 build_ascstring ("KSC5601"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1328 build_defer_string ("KSC5601 (Korean"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1329 build_defer_string ("KSC5601 Korean Hangul and Hanja"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1330 vector1(build_ascstring("ksc5601.1987-0")), 0, 0); |
428 | 1331 staticpro (&Vcharset_japanese_jisx0212); |
1332 Vcharset_japanese_jisx0212 = | |
1333 make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212, 3, | |
1334 CHARSET_TYPE_94X94, 2, 0, 'D', | |
1335 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1336 build_ascstring ("JISX0212"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1337 build_defer_string ("JISX0212 (Japanese)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1338 build_defer_string ("JISX0212 Japanese Supplement"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1339 vector1(build_ascstring("jisx0212.1990-0")), 0, 0); |
428 | 1340 |
3659 | 1341 #define CHINESE_CNS_PLANE(n) "cns11643.1992-" n |
428 | 1342 staticpro (&Vcharset_chinese_cns11643_1); |
1343 Vcharset_chinese_cns11643_1 = | |
1344 make_charset (LEADING_BYTE_CHINESE_CNS11643_1, Qchinese_cns11643_1, 3, | |
1345 CHARSET_TYPE_94X94, 2, 0, 'G', | |
1346 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1347 build_ascstring ("CNS11643-1"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1348 build_defer_string ("CNS11643-1 (Chinese traditional)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1349 build_defer_string |
428 | 1350 ("CNS 11643 Plane 1 Chinese traditional"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1351 vector1(build_ascstring (CHINESE_CNS_PLANE("1"))), 0, 0); |
428 | 1352 staticpro (&Vcharset_chinese_cns11643_2); |
1353 Vcharset_chinese_cns11643_2 = | |
1354 make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2, 3, | |
1355 CHARSET_TYPE_94X94, 2, 0, 'H', | |
1356 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1357 build_ascstring ("CNS11643-2"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1358 build_defer_string ("CNS11643-2 (Chinese traditional)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1359 build_defer_string |
428 | 1360 ("CNS 11643 Plane 2 Chinese traditional"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1361 vector1(build_ascstring (CHINESE_CNS_PLANE("2"))), 0, 0); |
428 | 1362 staticpro (&Vcharset_chinese_big5_1); |
1363 Vcharset_chinese_big5_1 = | |
1364 make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1, 3, | |
1365 CHARSET_TYPE_94X94, 2, 0, '0', | |
1366 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1367 build_ascstring ("Big5"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1368 build_defer_string ("Big5 (Level-1)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1369 build_defer_string |
428 | 1370 ("Big5 Level-1 Chinese traditional"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1371 vector1(build_ascstring ("big5.eten-0")), 0, 0); |
428 | 1372 staticpro (&Vcharset_chinese_big5_2); |
1373 Vcharset_chinese_big5_2 = | |
1374 make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, 3, | |
1375 CHARSET_TYPE_94X94, 2, 0, '1', | |
1376 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1377 build_ascstring ("Big5"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1378 build_defer_string ("Big5 (Level-2)"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1379 build_defer_string |
428 | 1380 ("Big5 Level-2 Chinese traditional"), |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1381 vector1(build_ascstring ("big5.eten-0")), 0, 0); |
428 | 1382 |
1383 | |
1384 #ifdef ENABLE_COMPOSITE_CHARS | |
1385 /* #### For simplicity, we put composite chars into a 96x96 charset. | |
1386 This is going to lead to problems because you can run out of | |
1387 room, esp. as we don't yet recycle numbers. */ | |
1388 staticpro (&Vcharset_composite); | |
1389 Vcharset_composite = | |
1390 make_charset (LEADING_BYTE_COMPOSITE, Qcomposite, 3, | |
1391 CHARSET_TYPE_96X96, 2, 0, 0, | |
1392 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1393 build_ascstring ("Composite"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1394 build_defer_string ("Composite characters"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1395 build_defer_string ("Composite characters"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1396 vector1(build_ascstring ("")), 0, 0); |
771 | 1397 #else |
1398 /* We create a hack so that we have a way of storing ESC 0 and ESC 1 | |
1399 sequences as "characters", so that they will be output correctly. */ | |
1400 staticpro (&Vcharset_composite); | |
1401 Vcharset_composite = | |
1402 make_charset (LEADING_BYTE_COMPOSITE_REPLACEMENT, Qcomposite, 2, | |
1403 CHARSET_TYPE_96, 1, 1, '|', | |
1404 CHARSET_LEFT_TO_RIGHT, | |
4952
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1405 build_ascstring ("Composite hack"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1406 build_defer_string ("Composite characters hack"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1407 build_defer_string ("Composite characters hack"), |
19a72041c5ed
Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents:
4846
diff
changeset
|
1408 vector1(build_ascstring ("")), 0, 0); |
428 | 1409 #endif /* ENABLE_COMPOSITE_CHARS */ |
1410 } |