Mercurial > hg > xemacs-beta
comparison src/symbols.c @ 4952:19a72041c5ed
Mule-izing, various fixes related to char * arguments
-------------------- ChangeLog entries follow: --------------------
modules/ChangeLog addition:
2010-01-26 Ben Wing <ben@xemacs.org>
* postgresql/postgresql.c:
* postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
* postgresql/postgresql.c (print_pgresult):
* postgresql/postgresql.c (Fpq_conn_defaults):
* postgresql/postgresql.c (Fpq_connectdb):
* postgresql/postgresql.c (Fpq_connect_start):
* postgresql/postgresql.c (Fpq_result_status):
* postgresql/postgresql.c (Fpq_res_status):
Mule-ize large parts of it.
2010-01-26 Ben Wing <ben@xemacs.org>
* ldap/eldap.c (print_ldap):
* ldap/eldap.c (allocate_ldap):
Use write_ascstring().
src/ChangeLog addition:
2010-01-26 Ben Wing <ben@xemacs.org>
* alloc.c:
* alloc.c (build_ascstring):
* alloc.c (build_msg_cistring):
* alloc.c (staticpro_1):
* alloc.c (staticpro_name):
* alloc.c (staticpro_nodump_1):
* alloc.c (staticpro_nodump_name):
* alloc.c (unstaticpro_nodump_1):
* alloc.c (mcpro_1):
* alloc.c (mcpro_name):
* alloc.c (object_memory_usage_stats):
* alloc.c (common_init_alloc_early):
* alloc.c (init_alloc_once_early):
* buffer.c (print_buffer):
* buffer.c (vars_of_buffer):
* buffer.c (common_init_complex_vars_of_buffer):
* buffer.c (init_initial_directory):
* bytecode.c (invalid_byte_code):
* bytecode.c (print_compiled_function):
* bytecode.c (mark_compiled_function):
* chartab.c (print_table_entry):
* chartab.c (print_char_table):
* config.h.in:
* console-gtk.c:
* console-gtk.c (gtk_device_to_console_connection):
* console-gtk.c (gtk_semi_canonicalize_console_connection):
* console-gtk.c (gtk_canonicalize_console_connection):
* console-gtk.c (gtk_semi_canonicalize_device_connection):
* console-gtk.c (gtk_canonicalize_device_connection):
* console-stream.c (stream_init_frame_1):
* console-stream.c (vars_of_console_stream):
* console-stream.c (init_console_stream):
* console-x.c (x_semi_canonicalize_console_connection):
* console-x.c (x_semi_canonicalize_device_connection):
* console-x.c (x_canonicalize_device_connection):
* console-x.h:
* data.c (eq_with_ebola_notice):
* data.c (Fsubr_interactive):
* data.c (Fnumber_to_string):
* data.c (digit_to_number):
* device-gtk.c (gtk_init_device):
* device-msw.c (print_devmode):
* device-x.c (x_event_name):
* dialog-msw.c (handle_directory_dialog_box):
* dialog-msw.c (handle_file_dialog_box):
* dialog-msw.c (vars_of_dialog_mswindows):
* doc.c (weird_doc):
* doc.c (Fsnarf_documentation):
* doc.c (vars_of_doc):
* dumper.c (pdump):
* dynarr.c:
* dynarr.c (Dynarr_realloc):
* editfns.c (Fuser_real_login_name):
* editfns.c (get_home_directory):
* elhash.c (print_hash_table_data):
* elhash.c (print_hash_table):
* emacs.c (main_1):
* emacs.c (vars_of_emacs):
* emodules.c:
* emodules.c (_emodules_list):
* emodules.c (Fload_module):
* emodules.c (Funload_module):
* emodules.c (Flist_modules):
* emodules.c (find_make_module):
* emodules.c (attempt_module_delete):
* emodules.c (emodules_load):
* emodules.c (emodules_doc_subr):
* emodules.c (emodules_doc_sym):
* emodules.c (syms_of_module):
* emodules.c (vars_of_module):
* emodules.h:
* eval.c (print_subr):
* eval.c (signal_call_debugger):
* eval.c (build_error_data):
* eval.c (signal_error):
* eval.c (maybe_signal_error):
* eval.c (signal_continuable_error):
* eval.c (maybe_signal_continuable_error):
* eval.c (signal_error_2):
* eval.c (maybe_signal_error_2):
* eval.c (signal_continuable_error_2):
* eval.c (maybe_signal_continuable_error_2):
* eval.c (signal_ferror):
* eval.c (maybe_signal_ferror):
* eval.c (signal_continuable_ferror):
* eval.c (maybe_signal_continuable_ferror):
* eval.c (signal_ferror_with_frob):
* eval.c (maybe_signal_ferror_with_frob):
* eval.c (signal_continuable_ferror_with_frob):
* eval.c (maybe_signal_continuable_ferror_with_frob):
* eval.c (syntax_error):
* eval.c (syntax_error_2):
* eval.c (maybe_syntax_error):
* eval.c (sferror):
* eval.c (sferror_2):
* eval.c (maybe_sferror):
* eval.c (invalid_argument):
* eval.c (invalid_argument_2):
* eval.c (maybe_invalid_argument):
* eval.c (invalid_constant):
* eval.c (invalid_constant_2):
* eval.c (maybe_invalid_constant):
* eval.c (invalid_operation):
* eval.c (invalid_operation_2):
* eval.c (maybe_invalid_operation):
* eval.c (invalid_change):
* eval.c (invalid_change_2):
* eval.c (maybe_invalid_change):
* eval.c (invalid_state):
* eval.c (invalid_state_2):
* eval.c (maybe_invalid_state):
* eval.c (wtaerror):
* eval.c (stack_overflow):
* eval.c (out_of_memory):
* eval.c (print_multiple_value):
* eval.c (issue_call_trapping_problems_warning):
* eval.c (backtrace_specials):
* eval.c (backtrace_unevalled_args):
* eval.c (Fbacktrace):
* eval.c (warn_when_safe):
* event-Xt.c (modwarn):
* event-Xt.c (modbarf):
* event-Xt.c (check_modifier):
* event-Xt.c (store_modifier):
* event-Xt.c (emacs_Xt_format_magic_event):
* event-Xt.c (describe_event):
* event-gtk.c (dragndrop_data_received):
* event-gtk.c (store_modifier):
* event-gtk.c (gtk_reset_modifier_mapping):
* event-msw.c (dde_eval_string):
* event-msw.c (Fdde_alloc_advise_item):
* event-msw.c (mswindows_dde_callback):
* event-msw.c (FROB):
* event-msw.c (emacs_mswindows_format_magic_event):
* event-stream.c (external_debugging_print_event):
* event-stream.c (execute_help_form):
* event-stream.c (vars_of_event_stream):
* events.c (print_event_1):
* events.c (print_event):
* events.c (event_equal):
* extents.c (print_extent_1):
* extents.c (print_extent):
* extents.c (vars_of_extents):
* faces.c (print_face):
* faces.c (complex_vars_of_faces):
* file-coding.c:
* file-coding.c (print_coding_system):
* file-coding.c (print_coding_system_in_print_method):
* file-coding.c (default_query_method):
* file-coding.c (find_coding_system):
* file-coding.c (make_coding_system_1):
* file-coding.c (chain_print):
* file-coding.c (undecided_print):
* file-coding.c (gzip_print):
* file-coding.c (vars_of_file_coding):
* file-coding.c (complex_vars_of_file_coding):
* fileio.c:
* fileio.c (report_file_type_error):
* fileio.c (report_error_with_errno):
* fileio.c (report_file_error):
* fileio.c (barf_or_query_if_file_exists):
* fileio.c (vars_of_fileio):
* floatfns.c (matherr):
* fns.c (print_bit_vector):
* fns.c (Fmapconcat):
* fns.c (add_suffix_to_symbol):
* fns.c (add_prefix_to_symbol):
* frame-gtk.c:
* frame-gtk.c (Fgtk_window_id):
* frame-x.c (def):
* frame-x.c (x_cde_transfer_callback):
* frame.c:
* frame.c (Fmake_frame):
* gc.c (show_gc_cursor_and_message):
* gc.c (vars_of_gc):
* glyphs-eimage.c (png_instantiate):
* glyphs-eimage.c (tiff_instantiate):
* glyphs-gtk.c (gtk_print_image_instance):
* glyphs-msw.c (mswindows_print_image_instance):
* glyphs-x.c (x_print_image_instance):
* glyphs-x.c (update_widget_face):
* glyphs.c (make_string_from_file):
* glyphs.c (print_image_instance):
* glyphs.c (signal_image_error):
* glyphs.c (signal_image_error_2):
* glyphs.c (signal_double_image_error):
* glyphs.c (signal_double_image_error_2):
* glyphs.c (xbm_mask_file_munging):
* glyphs.c (pixmap_to_lisp_data):
* glyphs.h:
* gui.c (gui_item_display_flush_left):
* hpplay.c (player_error_internal):
* hpplay.c (myHandler):
* intl-win32.c:
* intl-win32.c (langcode_to_lang):
* intl-win32.c (sublangcode_to_lang):
* intl-win32.c (Fmswindows_get_locale_info):
* intl-win32.c (lcid_to_locale_mule_or_no):
* intl-win32.c (mswindows_multibyte_to_unicode_print):
* intl-win32.c (complex_vars_of_intl_win32):
* keymap.c:
* keymap.c (print_keymap):
* keymap.c (ensure_meta_prefix_char_keymapp):
* keymap.c (Fkey_description):
* keymap.c (Ftext_char_description):
* lisp.h:
* lisp.h (struct):
* lisp.h (DECLARE_INLINE_HEADER):
* lread.c (Fload_internal):
* lread.c (locate_file):
* lread.c (read_escape):
* lread.c (read_raw_string):
* lread.c (read1):
* lread.c (read_list):
* lread.c (read_compiled_function):
* lread.c (init_lread):
* lrecord.h:
* marker.c (print_marker):
* marker.c (marker_equal):
* menubar-msw.c (displayable_menu_item):
* menubar-x.c (command_builder_operate_menu_accelerator):
* menubar.c (vars_of_menubar):
* minibuf.c (reinit_complex_vars_of_minibuf):
* minibuf.c (complex_vars_of_minibuf):
* mule-charset.c (Fmake_charset):
* mule-charset.c (complex_vars_of_mule_charset):
* mule-coding.c (iso2022_print):
* mule-coding.c (fixed_width_query):
* number.c (bignum_print):
* number.c (ratio_print):
* number.c (bigfloat_print):
* number.c (bigfloat_finalize):
* objects-msw.c:
* objects-msw.c (mswindows_color_to_string):
* objects-msw.c (mswindows_color_list):
* objects-tty.c:
* objects-tty.c (tty_font_list):
* objects-tty.c (tty_find_charset_font):
* objects-xlike-inc.c (xft_find_charset_font):
* objects-xlike-inc.c (endif):
* print.c:
* print.c (write_istring):
* print.c (write_ascstring):
* print.c (Fterpri):
* print.c (Fprint):
* print.c (print_error_message):
* print.c (print_vector_internal):
* print.c (print_cons):
* print.c (print_string):
* print.c (printing_unreadable_object):
* print.c (print_internal):
* print.c (print_float):
* print.c (print_symbol):
* process-nt.c (mswindows_report_winsock_error):
* process-nt.c (nt_canonicalize_host_name):
* process-unix.c (unix_canonicalize_host_name):
* process.c (print_process):
* process.c (report_process_error):
* process.c (report_network_error):
* process.c (make_process_internal):
* process.c (Fstart_process_internal):
* process.c (status_message):
* process.c (putenv_internal):
* process.c (vars_of_process):
* process.h:
* profile.c (vars_of_profile):
* rangetab.c (print_range_table):
* realpath.c (vars_of_realpath):
* redisplay.c (vars_of_redisplay):
* search.c (wordify):
* search.c (Freplace_match):
* sheap.c (sheap_adjust_h):
* sound.c (report_sound_error):
* sound.c (Fplay_sound_file):
* specifier.c (print_specifier):
* symbols.c (Fsubr_name):
* symbols.c (do_symval_forwarding):
* symbols.c (set_default_buffer_slot_variable):
* symbols.c (set_default_console_slot_variable):
* symbols.c (store_symval_forwarding):
* symbols.c (default_value):
* symbols.c (defsymbol_massage_name_1):
* symbols.c (defsymbol_massage_name_nodump):
* symbols.c (defsymbol_massage_name):
* symbols.c (defsymbol_massage_multiword_predicate_nodump):
* symbols.c (defsymbol_massage_multiword_predicate):
* symbols.c (defsymbol_nodump):
* symbols.c (defsymbol):
* symbols.c (defkeyword):
* symbols.c (defkeyword_massage_name):
* symbols.c (check_module_subr):
* symbols.c (deferror_1):
* symbols.c (deferror):
* symbols.c (deferror_massage_name):
* symbols.c (deferror_massage_name_and_message):
* symbols.c (defvar_magic):
* symeval.h:
* symeval.h (DEFVAR_SYMVAL_FWD):
* sysdep.c:
* sysdep.c (init_system_name):
* sysdll.c:
* sysdll.c (MAYBE_PREPEND_UNDERSCORE):
* sysdll.c (dll_function):
* sysdll.c (dll_variable):
* sysdll.c (dll_error):
* sysdll.c (dll_open):
* sysdll.c (dll_close):
* sysdll.c (image_for_address):
* sysdll.c (my_find_image):
* sysdll.c (search_linked_libs):
* sysdll.h:
* sysfile.h:
* sysfile.h (DEFAULT_DIRECTORY_FALLBACK):
* syswindows.h:
* tests.c (DFC_CHECK_LENGTH):
* tests.c (DFC_CHECK_CONTENT):
* tests.c (Ftest_hash_tables):
* text.c (vars_of_text):
* text.h:
* tooltalk.c (tt_opnum_string):
* tooltalk.c (tt_message_arg_ival_string):
* tooltalk.c (Ftooltalk_default_procid):
* tooltalk.c (Ftooltalk_default_session):
* tooltalk.c (init_tooltalk):
* tooltalk.c (vars_of_tooltalk):
* ui-gtk.c (Fdll_load):
* ui-gtk.c (type_to_marshaller_type):
* ui-gtk.c (Fgtk_import_function_internal):
* ui-gtk.c (emacs_gtk_object_printer):
* ui-gtk.c (emacs_gtk_boxed_printer):
* unicode.c (unicode_to_ichar):
* unicode.c (unicode_print):
* unicode.c (unicode_query):
* unicode.c (vars_of_unicode):
* unicode.c (complex_vars_of_unicode):
* win32.c:
* win32.c (mswindows_report_process_error):
* window.c (print_window):
* xemacs.def.in.in:
BASIC IDEA: Further fixing up uses of char * and CIbyte *
to reflect their actual semantics; Mule-izing some code;
redoing of the not-yet-working code to handle message translation.
Clean up code to handle message-translation (not yet working).
Create separate versions of build_msg_string() for working with
Ibyte *, CIbyte *, and Ascbyte * arguments. Assert that Ascbyte *
arguments are pure-ASCII. Make build_msg_string() be the same
as build_msg_ascstring(). Create same three versions of GETTEXT()
and DEFER_GETTEXT(). Also create build_defer_string() and
variants for the equivalent of DEFER_GETTEXT() when building a
string. Remove old CGETTEXT(). Clean up code where GETTEXT(),
DEFER_GETTEXT(), build_msg_string(), etc. was being called and
introduce some new calls to build_msg_string(), etc. Remove
GETTEXT() from calls to weird_doc() -- we assume that the
message snarfer knows about weird_doc(). Remove uses of
DEFER_GETTEXT() from error messages in sysdep.c and instead use
special comments /* @@@begin-snarf@@@ */ and /* @@@end-snarf@@@ */
that the message snarfer presumably knows about.
Create build_ascstring() and use it in many instances in place
of build_string(). The purpose of having Ascbyte * variants is
to make the code more self-documenting in terms of what sort of
semantics is expected for char * strings. In fact in the process
of looking for uses of build_string(), much improperly Mule-ized
was discovered.
Mule-ize a lot of code as described in previous paragraph,
e.g. in sysdep.c.
Make the error functions take Ascbyte * strings and fix up a
couple of places where non-pure-ASCII strings were being passed in
(file-coding.c, mule-coding.c, unicode.c). (It's debatable whether
we really need to make the error functions work this way. It
helps catch places where code is written in a way that message
translation won't work, but we may well never implement message
translation.)
Make staticpro() and friends take Ascbyte * strings instead of
raw char * strings. Create a const_Ascbyte_ptr dynarr type
to describe what's held by staticpro_names[] and friends,
create pdump descriptions for const_Ascbyte_ptr dynarrs, and
use them in place of specially-crafted staticpro descriptions.
Mule-ize certain other functions (e.g. x_event_name) by correcting
raw use of char * to Ascbyte *, Rawbyte * or another such type,
and raw use of char[] buffers to another type (usually Ascbyte[]).
Change many uses of write_c_string() to write_msg_string(),
write_ascstring(), etc.
Mule-ize emodules.c, emodules.h, sysdll.h.
Fix some un-Mule-ized code in intl-win32.c.
A comment in event-Xt.c and the limitations of the message
snarfer (make-msgfile or whatever) is presumably incorrect --
it should be smart enough to handle function calls spread over
more than one line. Clean up code in event-Xt.c that was
written awkwardly for this reason.
In config.h.in, instead of NEED_ERROR_CHECK_TYPES_INLINES,
create a more general XEMACS_DEFS_NEEDS_INLINE_DECLS to
indicate when inlined functions need to be declared in
xemacs.defs.in.in, and make use of it in xemacs.defs.in.in.
We need to do this because postgresql.c now calls qxestrdup(),
which is an inline function.
Make nconc2() and other such functions MODULE_API and put
them in xemacs.defs.in.in since postgresql.c now uses them.
Clean up indentation in lread.c and a few other places.
In text.h, document ASSERT_ASCTEXT_ASCII() and
ASSERT_ASCTEXT_ASCII_LEN(), group together the stand-in
encodings and add some more for DLL symbols, function and
variable names, etc.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Tue, 26 Jan 2010 23:22:30 -0600 |
parents | 9113c5044de8 |
children | 304aebb79cd3 |
comparison
equal
deleted
inserted
replaced
4951:de60897044f4 | 4952:19a72041c5ed |
---|---|
729 Return name of function SUBR. | 729 Return name of function SUBR. |
730 SUBR must be a built-in function. | 730 SUBR must be a built-in function. |
731 */ | 731 */ |
732 (subr)) | 732 (subr)) |
733 { | 733 { |
734 const char *name; | 734 const Ascbyte *name; |
735 CHECK_SUBR (subr); | 735 CHECK_SUBR (subr); |
736 | 736 |
737 name = XSUBR (subr)->name; | 737 name = XSUBR (subr)->name; |
738 return make_string ((const Ibyte *)name, strlen (name)); | 738 return make_string ((const Ibyte *)name, strlen (name)); |
739 } | 739 } |
1180 case SYMVAL_CONST_OBJECT_FORWARD: | 1180 case SYMVAL_CONST_OBJECT_FORWARD: |
1181 case SYMVAL_CONST_SPECIFIER_FORWARD: | 1181 case SYMVAL_CONST_SPECIFIER_FORWARD: |
1182 return *((Lisp_Object *)symbol_value_forward_forward (fwd)); | 1182 return *((Lisp_Object *)symbol_value_forward_forward (fwd)); |
1183 | 1183 |
1184 case SYMVAL_DEFAULT_BUFFER_FORWARD: | 1184 case SYMVAL_DEFAULT_BUFFER_FORWARD: |
1185 return (*((Lisp_Object *)((char *) XBUFFER (Vbuffer_defaults) | 1185 return (*((Lisp_Object *)((Rawbyte *) XBUFFER (Vbuffer_defaults) |
1186 + ((char *)symbol_value_forward_forward (fwd) | 1186 + ((Rawbyte *)symbol_value_forward_forward (fwd) |
1187 - (char *)&buffer_local_flags)))); | 1187 - (Rawbyte *)&buffer_local_flags)))); |
1188 | 1188 |
1189 | 1189 |
1190 case SYMVAL_CURRENT_BUFFER_FORWARD: | 1190 case SYMVAL_CURRENT_BUFFER_FORWARD: |
1191 case SYMVAL_CONST_CURRENT_BUFFER_FORWARD: | 1191 case SYMVAL_CONST_CURRENT_BUFFER_FORWARD: |
1192 assert (buffer); | 1192 assert (buffer); |
1193 return (*((Lisp_Object *)((char *)buffer | 1193 return (*((Lisp_Object *)((Rawbyte *)buffer |
1194 + ((char *)symbol_value_forward_forward (fwd) | 1194 + ((Rawbyte *)symbol_value_forward_forward (fwd) |
1195 - (char *)&buffer_local_flags)))); | 1195 - (Rawbyte *)&buffer_local_flags)))); |
1196 | 1196 |
1197 case SYMVAL_DEFAULT_CONSOLE_FORWARD: | 1197 case SYMVAL_DEFAULT_CONSOLE_FORWARD: |
1198 return (*((Lisp_Object *)((char *) XCONSOLE (Vconsole_defaults) | 1198 return (*((Lisp_Object *)((Rawbyte *) XCONSOLE (Vconsole_defaults) |
1199 + ((char *)symbol_value_forward_forward (fwd) | 1199 + ((Rawbyte *)symbol_value_forward_forward (fwd) |
1200 - (char *)&console_local_flags)))); | 1200 - (Rawbyte *)&console_local_flags)))); |
1201 | 1201 |
1202 case SYMVAL_SELECTED_CONSOLE_FORWARD: | 1202 case SYMVAL_SELECTED_CONSOLE_FORWARD: |
1203 case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD: | 1203 case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD: |
1204 assert (console); | 1204 assert (console); |
1205 return (*((Lisp_Object *)((char *)console | 1205 return (*((Lisp_Object *)((Rawbyte *)console |
1206 + ((char *)symbol_value_forward_forward (fwd) | 1206 + ((Rawbyte *)symbol_value_forward_forward (fwd) |
1207 - (char *)&console_local_flags)))); | 1207 - (Rawbyte *)&console_local_flags)))); |
1208 | 1208 |
1209 case SYMVAL_UNBOUND_MARKER: | 1209 case SYMVAL_UNBOUND_MARKER: |
1210 return valcontents; | 1210 return valcontents; |
1211 | 1211 |
1212 default: | 1212 default: |
1228 or symbol-value-buffer-local, and if there's a handler, we should | 1228 or symbol-value-buffer-local, and if there's a handler, we should |
1229 have already called it. */ | 1229 have already called it. */ |
1230 Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt); | 1230 Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt); |
1231 const struct symbol_value_forward *fwd | 1231 const struct symbol_value_forward *fwd |
1232 = XSYMBOL_VALUE_FORWARD (valcontents); | 1232 = XSYMBOL_VALUE_FORWARD (valcontents); |
1233 int offset = ((char *) symbol_value_forward_forward (fwd) | 1233 int offset = ((Rawbyte *) symbol_value_forward_forward (fwd) |
1234 - (char *) &buffer_local_flags); | 1234 - (Rawbyte *) &buffer_local_flags); |
1235 int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); | 1235 int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); |
1236 int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object, | 1236 int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object, |
1237 int flags) = symbol_value_forward_magicfun (fwd); | 1237 int flags) = symbol_value_forward_magicfun (fwd); |
1238 | 1238 |
1239 *((Lisp_Object *) (offset + (char *) XBUFFER (Vbuffer_defaults))) | 1239 *((Lisp_Object *) (offset + (Rawbyte *) XBUFFER (Vbuffer_defaults))) |
1240 = value; | 1240 = value; |
1241 | 1241 |
1242 if (mask > 0) /* Not always per-buffer */ | 1242 if (mask > 0) /* Not always per-buffer */ |
1243 { | 1243 { |
1244 /* Set value in each buffer which hasn't shadowed the default */ | 1244 /* Set value in each buffer which hasn't shadowed the default */ |
1247 struct buffer *b = XBUFFER (XCDR (elt)); | 1247 struct buffer *b = XBUFFER (XCDR (elt)); |
1248 if (!(b->local_var_flags & mask)) | 1248 if (!(b->local_var_flags & mask)) |
1249 { | 1249 { |
1250 if (magicfun) | 1250 if (magicfun) |
1251 magicfun (sym, &value, wrap_buffer (b), 0); | 1251 magicfun (sym, &value, wrap_buffer (b), 0); |
1252 *((Lisp_Object *) (offset + (char *) b)) = value; | 1252 *((Lisp_Object *) (offset + (Rawbyte *) b)) = value; |
1253 } | 1253 } |
1254 } | 1254 } |
1255 } | 1255 } |
1256 } | 1256 } |
1257 | 1257 |
1268 or symbol-value-buffer-local, and if there's a handler, we should | 1268 or symbol-value-buffer-local, and if there's a handler, we should |
1269 have already called it. */ | 1269 have already called it. */ |
1270 Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt); | 1270 Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt); |
1271 const struct symbol_value_forward *fwd | 1271 const struct symbol_value_forward *fwd |
1272 = XSYMBOL_VALUE_FORWARD (valcontents); | 1272 = XSYMBOL_VALUE_FORWARD (valcontents); |
1273 int offset = ((char *) symbol_value_forward_forward (fwd) | 1273 int offset = ((Rawbyte *) symbol_value_forward_forward (fwd) |
1274 - (char *) &console_local_flags); | 1274 - (Rawbyte *) &console_local_flags); |
1275 int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); | 1275 int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); |
1276 int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object, | 1276 int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object, |
1277 int flags) = symbol_value_forward_magicfun (fwd); | 1277 int flags) = symbol_value_forward_magicfun (fwd); |
1278 | 1278 |
1279 *((Lisp_Object *) (offset + (char *) XCONSOLE (Vconsole_defaults))) | 1279 *((Lisp_Object *) (offset + (Rawbyte *) XCONSOLE (Vconsole_defaults))) |
1280 = value; | 1280 = value; |
1281 | 1281 |
1282 if (mask > 0) /* Not always per-console */ | 1282 if (mask > 0) /* Not always per-console */ |
1283 { | 1283 { |
1284 /* Set value in each console which hasn't shadowed the default */ | 1284 /* Set value in each console which hasn't shadowed the default */ |
1287 struct console *d = XCONSOLE (console); | 1287 struct console *d = XCONSOLE (console); |
1288 if (!(d->local_var_flags & mask)) | 1288 if (!(d->local_var_flags & mask)) |
1289 { | 1289 { |
1290 if (magicfun) | 1290 if (magicfun) |
1291 magicfun (sym, &value, console, 0); | 1291 magicfun (sym, &value, console, 0); |
1292 *((Lisp_Object *) (offset + (char *) d)) = value; | 1292 *((Lisp_Object *) (offset + (Rawbyte *) d)) = value; |
1293 } | 1293 } |
1294 } | 1294 } |
1295 } | 1295 } |
1296 } | 1296 } |
1297 | 1297 |
1364 return; | 1364 return; |
1365 | 1365 |
1366 case SYMVAL_CURRENT_BUFFER_FORWARD: | 1366 case SYMVAL_CURRENT_BUFFER_FORWARD: |
1367 if (magicfun) | 1367 if (magicfun) |
1368 magicfun (sym, &newval, wrap_buffer (current_buffer), 0); | 1368 magicfun (sym, &newval, wrap_buffer (current_buffer), 0); |
1369 *((Lisp_Object *) ((char *) current_buffer | 1369 *((Lisp_Object *) ((Rawbyte *) current_buffer |
1370 + ((char *) symbol_value_forward_forward (fwd) | 1370 + ((Rawbyte *) symbol_value_forward_forward (fwd) |
1371 - (char *) &buffer_local_flags))) | 1371 - (Rawbyte *) &buffer_local_flags))) |
1372 = newval; | 1372 = newval; |
1373 return; | 1373 return; |
1374 | 1374 |
1375 case SYMVAL_DEFAULT_CONSOLE_FORWARD: | 1375 case SYMVAL_DEFAULT_CONSOLE_FORWARD: |
1376 set_default_console_slot_variable (sym, newval); | 1376 set_default_console_slot_variable (sym, newval); |
1377 return; | 1377 return; |
1378 | 1378 |
1379 case SYMVAL_SELECTED_CONSOLE_FORWARD: | 1379 case SYMVAL_SELECTED_CONSOLE_FORWARD: |
1380 if (magicfun) | 1380 if (magicfun) |
1381 magicfun (sym, &newval, Vselected_console, 0); | 1381 magicfun (sym, &newval, Vselected_console, 0); |
1382 *((Lisp_Object *) ((char *) XCONSOLE (Vselected_console) | 1382 *((Lisp_Object *) ((Rawbyte *) XCONSOLE (Vselected_console) |
1383 + ((char *) symbol_value_forward_forward (fwd) | 1383 + ((Rawbyte *) symbol_value_forward_forward (fwd) |
1384 - (char *) &console_local_flags))) | 1384 - (Rawbyte *) &console_local_flags))) |
1385 = newval; | 1385 = newval; |
1386 return; | 1386 return; |
1387 | 1387 |
1388 default: | 1388 default: |
1389 ABORT (); | 1389 ABORT (); |
2056 | 2056 |
2057 case SYMVAL_CURRENT_BUFFER_FORWARD: | 2057 case SYMVAL_CURRENT_BUFFER_FORWARD: |
2058 { | 2058 { |
2059 const struct symbol_value_forward *fwd | 2059 const struct symbol_value_forward *fwd |
2060 = XSYMBOL_VALUE_FORWARD (valcontents); | 2060 = XSYMBOL_VALUE_FORWARD (valcontents); |
2061 return (*((Lisp_Object *)((char *) XBUFFER (Vbuffer_defaults) | 2061 return (*((Lisp_Object *)((Rawbyte *) XBUFFER (Vbuffer_defaults) |
2062 + ((char *)symbol_value_forward_forward (fwd) | 2062 + ((Rawbyte *)symbol_value_forward_forward (fwd) |
2063 - (char *)&buffer_local_flags)))); | 2063 - (Rawbyte *)&buffer_local_flags)))); |
2064 } | 2064 } |
2065 | 2065 |
2066 case SYMVAL_SELECTED_CONSOLE_FORWARD: | 2066 case SYMVAL_SELECTED_CONSOLE_FORWARD: |
2067 { | 2067 { |
2068 const struct symbol_value_forward *fwd | 2068 const struct symbol_value_forward *fwd |
2069 = XSYMBOL_VALUE_FORWARD (valcontents); | 2069 = XSYMBOL_VALUE_FORWARD (valcontents); |
2070 return (*((Lisp_Object *)((char *) XCONSOLE (Vconsole_defaults) | 2070 return (*((Lisp_Object *)((Rawbyte *) XCONSOLE (Vconsole_defaults) |
2071 + ((char *)symbol_value_forward_forward (fwd) | 2071 + ((Rawbyte *)symbol_value_forward_forward (fwd) |
2072 - (char *)&console_local_flags)))); | 2072 - (Rawbyte *)&console_local_flags)))); |
2073 } | 2073 } |
2074 | 2074 |
2075 case SYMVAL_BUFFER_LOCAL: | 2075 case SYMVAL_BUFFER_LOCAL: |
2076 case SYMVAL_SOME_BUFFER_LOCAL: | 2076 case SYMVAL_SOME_BUFFER_LOCAL: |
2077 { | 2077 { |
2503 | 2503 |
2504 case SYMVAL_CURRENT_BUFFER_FORWARD: | 2504 case SYMVAL_CURRENT_BUFFER_FORWARD: |
2505 { | 2505 { |
2506 const struct symbol_value_forward *fwd | 2506 const struct symbol_value_forward *fwd |
2507 = XSYMBOL_VALUE_FORWARD (valcontents); | 2507 = XSYMBOL_VALUE_FORWARD (valcontents); |
2508 int offset = ((char *) symbol_value_forward_forward (fwd) | 2508 int offset = ((Rawbyte *) symbol_value_forward_forward (fwd) |
2509 - (char *) &buffer_local_flags); | 2509 - (Rawbyte *) &buffer_local_flags); |
2510 int mask = | 2510 int mask = |
2511 XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); | 2511 XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); |
2512 | 2512 |
2513 if (mask > 0) | 2513 if (mask > 0) |
2514 { | 2514 { |
2515 int (*magicfun) (Lisp_Object sym, Lisp_Object *val, | 2515 int (*magicfun) (Lisp_Object sym, Lisp_Object *val, |
2516 Lisp_Object in_object, int flags) = | 2516 Lisp_Object in_object, int flags) = |
2517 symbol_value_forward_magicfun (fwd); | 2517 symbol_value_forward_magicfun (fwd); |
2518 Lisp_Object oldval = * (Lisp_Object *) | 2518 Lisp_Object oldval = * (Lisp_Object *) |
2519 (offset + (char *) XBUFFER (Vbuffer_defaults)); | 2519 (offset + (Rawbyte *) XBUFFER (Vbuffer_defaults)); |
2520 if (magicfun) | 2520 if (magicfun) |
2521 (magicfun) (variable, &oldval, wrap_buffer (current_buffer), 0); | 2521 (magicfun) (variable, &oldval, wrap_buffer (current_buffer), 0); |
2522 *(Lisp_Object *) (offset + (char *) current_buffer) | 2522 *(Lisp_Object *) (offset + (Rawbyte *) current_buffer) |
2523 = oldval; | 2523 = oldval; |
2524 current_buffer->local_var_flags &= ~mask; | 2524 current_buffer->local_var_flags &= ~mask; |
2525 } | 2525 } |
2526 return variable; | 2526 return variable; |
2527 } | 2527 } |
2597 | 2597 |
2598 case SYMVAL_SELECTED_CONSOLE_FORWARD: | 2598 case SYMVAL_SELECTED_CONSOLE_FORWARD: |
2599 { | 2599 { |
2600 const struct symbol_value_forward *fwd | 2600 const struct symbol_value_forward *fwd |
2601 = XSYMBOL_VALUE_FORWARD (valcontents); | 2601 = XSYMBOL_VALUE_FORWARD (valcontents); |
2602 int offset = ((char *) symbol_value_forward_forward (fwd) | 2602 int offset = ((Rawbyte *) symbol_value_forward_forward (fwd) |
2603 - (char *) &console_local_flags); | 2603 - (Rawbyte *) &console_local_flags); |
2604 int mask = | 2604 int mask = |
2605 XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); | 2605 XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); |
2606 | 2606 |
2607 if (mask > 0) | 2607 if (mask > 0) |
2608 { | 2608 { |
2609 int (*magicfun) (Lisp_Object sym, Lisp_Object *val, | 2609 int (*magicfun) (Lisp_Object sym, Lisp_Object *val, |
2610 Lisp_Object in_object, int flags) = | 2610 Lisp_Object in_object, int flags) = |
2611 symbol_value_forward_magicfun (fwd); | 2611 symbol_value_forward_magicfun (fwd); |
2612 Lisp_Object oldval = * (Lisp_Object *) | 2612 Lisp_Object oldval = * (Lisp_Object *) |
2613 (offset + (char *) XCONSOLE (Vconsole_defaults)); | 2613 (offset + (Rawbyte *) XCONSOLE (Vconsole_defaults)); |
2614 if (magicfun) | 2614 if (magicfun) |
2615 magicfun (variable, &oldval, Vselected_console, 0); | 2615 magicfun (variable, &oldval, Vselected_console, 0); |
2616 *(Lisp_Object *) (offset + (char *) XCONSOLE (Vselected_console)) | 2616 *(Lisp_Object *) (offset + (Rawbyte *) XCONSOLE (Vselected_console)) |
2617 = oldval; | 2617 = oldval; |
2618 XCONSOLE (Vselected_console)->local_var_flags &= ~mask; | 2618 XCONSOLE (Vselected_console)->local_var_flags &= ~mask; |
2619 } | 2619 } |
2620 return variable; | 2620 return variable; |
2621 } | 2621 } |
3588 reinit_symbols_early (void) | 3588 reinit_symbols_early (void) |
3589 { | 3589 { |
3590 } | 3590 } |
3591 | 3591 |
3592 static void | 3592 static void |
3593 defsymbol_massage_name_1 (Lisp_Object *location, const char *name, int dump_p, | 3593 defsymbol_massage_name_1 (Lisp_Object *location, const Ascbyte *name, int dump_p, |
3594 int multiword_predicate_p) | 3594 int multiword_predicate_p) |
3595 { | 3595 { |
3596 char temp[500]; | 3596 char temp[500]; |
3597 int len = strlen (name) - 1; | 3597 int len = strlen (name) - 1; |
3598 int i; | 3598 int i; |
3616 else | 3616 else |
3617 staticpro_nodump (location); | 3617 staticpro_nodump (location); |
3618 } | 3618 } |
3619 | 3619 |
3620 void | 3620 void |
3621 defsymbol_massage_name_nodump (Lisp_Object *location, const char *name) | 3621 defsymbol_massage_name_nodump (Lisp_Object *location, const Ascbyte *name) |
3622 { | 3622 { |
3623 defsymbol_massage_name_1 (location, name, 0, 0); | 3623 defsymbol_massage_name_1 (location, name, 0, 0); |
3624 } | 3624 } |
3625 | 3625 |
3626 void | 3626 void |
3627 defsymbol_massage_name (Lisp_Object *location, const char *name) | 3627 defsymbol_massage_name (Lisp_Object *location, const Ascbyte *name) |
3628 { | 3628 { |
3629 defsymbol_massage_name_1 (location, name, 1, 0); | 3629 defsymbol_massage_name_1 (location, name, 1, 0); |
3630 } | 3630 } |
3631 | 3631 |
3632 void | 3632 void |
3633 defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location, | 3633 defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location, |
3634 const char *name) | 3634 const Ascbyte *name) |
3635 { | 3635 { |
3636 defsymbol_massage_name_1 (location, name, 0, 1); | 3636 defsymbol_massage_name_1 (location, name, 0, 1); |
3637 } | 3637 } |
3638 | 3638 |
3639 void | 3639 void |
3640 defsymbol_massage_multiword_predicate (Lisp_Object *location, const char *name) | 3640 defsymbol_massage_multiword_predicate (Lisp_Object *location, const Ascbyte *name) |
3641 { | 3641 { |
3642 defsymbol_massage_name_1 (location, name, 1, 1); | 3642 defsymbol_massage_name_1 (location, name, 1, 1); |
3643 } | 3643 } |
3644 | 3644 |
3645 void | 3645 void |
3646 defsymbol_nodump (Lisp_Object *location, const char *name) | 3646 defsymbol_nodump (Lisp_Object *location, const Ascbyte *name) |
3647 { | 3647 { |
3648 *location = Fintern (make_string_nocopy ((const Ibyte *) name, | 3648 *location = Fintern (make_string_nocopy ((const Ibyte *) name, |
3649 strlen (name)), | 3649 strlen (name)), |
3650 Qnil); | 3650 Qnil); |
3651 staticpro_nodump (location); | 3651 staticpro_nodump (location); |
3652 } | 3652 } |
3653 | 3653 |
3654 void | 3654 void |
3655 defsymbol (Lisp_Object *location, const char *name) | 3655 defsymbol (Lisp_Object *location, const Ascbyte *name) |
3656 { | 3656 { |
3657 *location = Fintern (make_string_nocopy ((const Ibyte *) name, | 3657 *location = Fintern (make_string_nocopy ((const Ibyte *) name, |
3658 strlen (name)), | 3658 strlen (name)), |
3659 Qnil); | 3659 Qnil); |
3660 staticpro (location); | 3660 staticpro (location); |
3661 } | 3661 } |
3662 | 3662 |
3663 void | 3663 void |
3664 defkeyword (Lisp_Object *location, const char *name) | 3664 defkeyword (Lisp_Object *location, const Ascbyte *name) |
3665 { | 3665 { |
3666 defsymbol (location, name); | 3666 defsymbol (location, name); |
3667 Fset (*location, *location); | 3667 Fset (*location, *location); |
3668 } | 3668 } |
3669 | 3669 |
3670 void | 3670 void |
3671 defkeyword_massage_name (Lisp_Object *location, const char *name) | 3671 defkeyword_massage_name (Lisp_Object *location, const Ascbyte *name) |
3672 { | 3672 { |
3673 char temp[500]; | 3673 char temp[500]; |
3674 int len = strlen (name); | 3674 int len = strlen (name); |
3675 | 3675 |
3676 assert (len < (int) sizeof (temp)); | 3676 assert (len < (int) sizeof (temp)); |
3759 if (!UNBOUNDP (f) && (!CONSP (f) || !EQ (XCAR (f), Qautoload))) \ | 3759 if (!UNBOUNDP (f) && (!CONSP (f) || !EQ (XCAR (f), Qautoload))) \ |
3760 signal_ferror (Qdll_error, "Attempt to redefine %s", subr_name (subr)); \ | 3760 signal_ferror (Qdll_error, "Attempt to redefine %s", subr_name (subr)); \ |
3761 \ | 3761 \ |
3762 newsubr = xnew (Lisp_Subr); \ | 3762 newsubr = xnew (Lisp_Subr); \ |
3763 memcpy (newsubr, subr, sizeof (Lisp_Subr)); \ | 3763 memcpy (newsubr, subr, sizeof (Lisp_Subr)); \ |
3764 subr->doc = (const char *)newsubr; \ | 3764 subr->doc = (const CIbyte *)newsubr; \ |
3765 subr = newsubr; \ | 3765 subr = newsubr; \ |
3766 } \ | 3766 } \ |
3767 } while (0) | 3767 } while (0) |
3768 #else /* NEW_GC */ | 3768 #else /* NEW_GC */ |
3769 /* | 3769 /* |
3846 LOADHIST_ATTACH (sym); | 3846 LOADHIST_ATTACH (sym); |
3847 #endif | 3847 #endif |
3848 } | 3848 } |
3849 | 3849 |
3850 static void | 3850 static void |
3851 deferror_1 (Lisp_Object *symbol, const char *name, const char *messuhhj, | 3851 deferror_1 (Lisp_Object *symbol, const Ascbyte *name, const Ascbyte *messuhhj, |
3852 Lisp_Object inherits_from, int massage_p) | 3852 Lisp_Object inherits_from, int massage_p) |
3853 { | 3853 { |
3854 Lisp_Object conds; | 3854 Lisp_Object conds; |
3855 if (massage_p) | 3855 if (massage_p) |
3856 defsymbol_massage_name (symbol, name); | 3856 defsymbol_massage_name (symbol, name); |
3861 conds = Fget (inherits_from, Qerror_conditions, Qnil); | 3861 conds = Fget (inherits_from, Qerror_conditions, Qnil); |
3862 Fput (*symbol, Qerror_conditions, Fcons (*symbol, conds)); | 3862 Fput (*symbol, Qerror_conditions, Fcons (*symbol, conds)); |
3863 /* NOT build_msg_string (). This function is called at load time | 3863 /* NOT build_msg_string (). This function is called at load time |
3864 and the string needs to get translated at run time. (This happens | 3864 and the string needs to get translated at run time. (This happens |
3865 in the function (display-error) in cmdloop.el.) */ | 3865 in the function (display-error) in cmdloop.el.) */ |
3866 Fput (*symbol, Qerror_message, build_msg_string (messuhhj)); | 3866 Fput (*symbol, Qerror_message, build_defer_string (messuhhj)); |
3867 } | 3867 } |
3868 | 3868 |
3869 void | 3869 void |
3870 deferror (Lisp_Object *symbol, const char *name, const char *messuhhj, | 3870 deferror (Lisp_Object *symbol, const Ascbyte *name, const Ascbyte *messuhhj, |
3871 Lisp_Object inherits_from) | 3871 Lisp_Object inherits_from) |
3872 { | 3872 { |
3873 deferror_1 (symbol, name, messuhhj, inherits_from, 0); | 3873 deferror_1 (symbol, name, messuhhj, inherits_from, 0); |
3874 } | 3874 } |
3875 | 3875 |
3876 void | 3876 void |
3877 deferror_massage_name (Lisp_Object *symbol, const char *name, | 3877 deferror_massage_name (Lisp_Object *symbol, const Ascbyte *name, |
3878 const char *messuhhj, Lisp_Object inherits_from) | 3878 const Ascbyte *messuhhj, Lisp_Object inherits_from) |
3879 { | 3879 { |
3880 deferror_1 (symbol, name, messuhhj, inherits_from, 1); | 3880 deferror_1 (symbol, name, messuhhj, inherits_from, 1); |
3881 } | 3881 } |
3882 | 3882 |
3883 void | 3883 void |
3884 deferror_massage_name_and_message (Lisp_Object *symbol, const char *name, | 3884 deferror_massage_name_and_message (Lisp_Object *symbol, const Ascbyte *name, |
3885 Lisp_Object inherits_from) | 3885 Lisp_Object inherits_from) |
3886 { | 3886 { |
3887 char temp[500]; | 3887 char temp[500]; |
3888 int i; | 3888 int i; |
3889 int len = strlen (name) - 1; | 3889 int len = strlen (name) - 1; |
3983 DEFSUBR (Fdontusethis_set_symbol_value_handler); | 3983 DEFSUBR (Fdontusethis_set_symbol_value_handler); |
3984 } | 3984 } |
3985 | 3985 |
3986 /* Create and initialize a Lisp variable whose value is forwarded to C data */ | 3986 /* Create and initialize a Lisp variable whose value is forwarded to C data */ |
3987 void | 3987 void |
3988 defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic) | 3988 defvar_magic (const Ascbyte *symbol_name, |
3989 const struct symbol_value_forward *magic) | |
3989 { | 3990 { |
3990 Lisp_Object sym; | 3991 Lisp_Object sym; |
3991 | 3992 |
3992 #ifdef HAVE_SHLIB | 3993 #ifdef HAVE_SHLIB |
3993 /* | 3994 /* |
3995 * we are adding variables from a dynamically loaded module. That means | 3996 * we are adding variables from a dynamically loaded module. That means |
3996 * we can't use purespace. Take that into account. | 3997 * we can't use purespace. Take that into account. |
3997 */ | 3998 */ |
3998 if (initialized) | 3999 if (initialized) |
3999 { | 4000 { |
4000 sym = Fintern (build_string (symbol_name), Qnil); | 4001 sym = Fintern (build_ascstring (symbol_name), Qnil); |
4001 LOADHIST_ATTACH (sym); | 4002 LOADHIST_ATTACH (sym); |
4002 } | 4003 } |
4003 else | 4004 else |
4004 #endif | 4005 #endif |
4005 sym = Fintern (make_string_nocopy ((const Ibyte *) symbol_name, | 4006 sym = Fintern (make_string_nocopy ((const Ibyte *) symbol_name, |