Mercurial > hg > xemacs-beta
changeset 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.
line wrap: on
line diff
--- a/modules/ChangeLog Tue Jan 26 22:48:23 2010 -0600 +++ b/modules/ChangeLog Tue Jan 26 23:22:30 2010 -0600 @@ -1,3 +1,21 @@ +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(). + 2010-01-24 Ben Wing <ben@xemacs.org> * postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
--- a/modules/ldap/eldap.c Tue Jan 26 22:48:23 2010 -0600 +++ b/modules/ldap/eldap.c Tue Jan 26 23:22:30 2010 -0600 @@ -134,7 +134,7 @@ write_fmt_string_lisp (printcharfun, "#<ldap %S", 1, ldap->host); if (!ldap->ld) - write_c_string (printcharfun,"(dead) "); + write_ascstring (printcharfun,"(dead) "); write_fmt_string (printcharfun, " 0x%lx>", (long)ldap); }
--- a/modules/postgresql/postgresql.c Tue Jan 26 22:48:23 2010 -0600 +++ b/modules/postgresql/postgresql.c Tue Jan 26 23:22:30 2010 -0600 @@ -118,15 +118,28 @@ Lisp_Object Vpg_coding_system; #endif -#define CHECK_LIVE_CONNECTION(P) do { \ - if (!P || (PQstatus (P) != CONNECTION_OK)) { \ - const char *e = "bad value"; \ - if (P) e = PQerrorMessage (P); \ - signal_ferror (Qprocess_error, "dead connection [%s]", e); \ - } } while (0) -#define PUKE_IF_NULL(p) do { \ - if (!p) signal_error (Qinvalid_argument, "bad value", Qunbound); \ - } while (0) +#define CHECK_LIVE_CONNECTION(P) \ +do \ +{ \ + if (!P || (PQstatus (P) != CONNECTION_OK)) \ + { \ + const Ibyte *err; \ + \ + if (P) \ + err = NEW_EXTERNAL_TO_C_STRING (PQerrorMessage (P), PG_OS_CODING); \ + else \ + err = (const Ibyte *) "bad value"; \ + signal_ferror (Qprocess_error, "dead connection [%s]", err); \ + } \ +} \ +while (0) + +#define PUKE_IF_NULL(p) \ +do \ +{ \ + if (!p) signal_error (Qinvalid_argument, "bad value", Qunbound); \ +} \ +while (0) static Lisp_Object VXPGHOST; static Lisp_Object VXPGUSER; @@ -338,7 +351,7 @@ PQcmdStatus (res)); break; default: -notuples: + notuples: /* No counts to print */ sprintf (buf, RESULT_DEFAULT_FMT, /* evil! */ PQresStatus (PQresultStatus (res)), @@ -431,23 +444,25 @@ pcio = PQconndefaults(); if (!pcio) return Qnil; /* can never happen in libpq-7.0 */ - temp = list1 (Fcons (build_ext_string (pcio[0].keyword, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].envvar, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].compiled, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].val, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].label, PG_OS_CODING), - Fcons (build_ext_string (pcio[0].dispchar, PG_OS_CODING), - Fcons (make_int (pcio[0].dispsize), Qnil)))))))); + temp = + list1 (nconc2 (list4 (build_ext_string (pcio[0].keyword, PG_OS_CODING), + build_ext_string (pcio[0].envvar, PG_OS_CODING), + build_ext_string (pcio[0].compiled, PG_OS_CODING), + build_ext_string (pcio[0].val, PG_OS_CODING)), + list3 (build_ext_string (pcio[0].label, PG_OS_CODING), + build_ext_string (pcio[0].dispchar, PG_OS_CODING), + make_int (pcio[0].dispsize)))); for (i = 1; pcio[i].keyword; i++) { - temp1 = list1 (Fcons (build_ext_string (pcio[i].keyword, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].envvar, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].compiled, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].val, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].label, PG_OS_CODING), - Fcons (build_ext_string (pcio[i].dispchar, PG_OS_CODING), - Fcons (make_int (pcio[i].dispsize), Qnil)))))))); + temp1 = + list1 (nconc2 (list4 (build_ext_string (pcio[i].keyword, PG_OS_CODING), + build_ext_string (pcio[i].envvar, PG_OS_CODING), + build_ext_string (pcio[i].compiled, PG_OS_CODING), + build_ext_string (pcio[i].val, PG_OS_CODING)), + list3 (build_ext_string (pcio[i].label, PG_OS_CODING), + build_ext_string (pcio[i].dispchar, PG_OS_CODING), + make_int (pcio[i].dispsize)))); { Lisp_Object args[2]; args[0] = temp; @@ -472,35 +487,33 @@ { PGconn *P; Lisp_PGconn *lisp_pgconn; - const char *error_message = "Out of Memory?"; - char *c_conninfo; + const Ascbyte *error_message = "Out of Memory?"; + Extbyte *c_conninfo; CHECK_STRING (conninfo); - TO_EXTERNAL_FORMAT(LISP_STRING, conninfo, - C_STRING_ALLOCA, c_conninfo, Qnative); + LISP_STRING_TO_EXTERNAL (conninfo, c_conninfo, PG_OS_CODING); P = PQconnectdb (c_conninfo); if (P && (PQstatus (P) == CONNECTION_OK)) { (void)PQsetNoticeProcessor (P, xemacs_notice_processor, NULL); - lisp_pgconn = allocate_pgconn(); + lisp_pgconn = allocate_pgconn (); lisp_pgconn->pgconn = P; return make_pgconn (lisp_pgconn); } else { /* Connection failed. Destroy the connection and signal an error. */ - char buf[BLCKSZ]; - strcpy (buf, error_message); + Ibyte *errmsg = (Ibyte *) error_message; if (P) { /* storage for the error message gets erased when call PQfinish */ - /* so we must temporarily stash it somewhere */ - strncpy (buf, PQerrorMessage (P), sizeof (buf)); - buf[sizeof (buf) - 1] = '\0'; + /* so we must temporarily stash it somewhere -- make alloca() copy */ + errmsg = NEW_EXTERNAL_TO_C_STRING (PQerrorMessage (P), PG_OS_CODING); + IBYTE_STRING_TO_ALLOCA (errmsg, errmsg); PQfinish (P); } - signal_ferror (Qprocess_error, "libpq: %s", buf); + signal_ferror (Qprocess_error, "libpq: %s", errmsg); } } @@ -517,18 +530,18 @@ { PGconn *P; Lisp_PGconn *lisp_pgconn; - const char *error_message = "Out of Memory?"; - char *c_conninfo; + const Ascbyte *error_message = "Out of Memory?"; + Extbyte *c_conninfo; CHECK_STRING (conninfo); - TO_EXTERNAL_FORMAT (LISP_STRING, conninfo, - C_STRING_ALLOCA, c_conninfo, Qnative); + + LISP_STRING_TO_EXTERNAL (conninfo, c_conninfo, PG_OS_CODING); P = PQconnectStart (c_conninfo); if (P && (PQstatus (P) != CONNECTION_BAD)) { (void)PQsetNoticeProcessor (P, xemacs_notice_processor, NULL); - lisp_pgconn = allocate_pgconn(); + lisp_pgconn = allocate_pgconn (); lisp_pgconn->pgconn = P; return make_pgconn (lisp_pgconn); @@ -1046,7 +1059,9 @@ case PGRES_FATAL_ERROR: return Qpgres_fatal_error; default: /* they've added a new field we don't know about */ - signal_ferror (Qprocess_error, "Help! Unknown exec status code %08x from backend!", est); + signal_ferror (Qprocess_error, + "Help! Unknown exec status code %08x from backend!", + est); } }
--- a/src/ChangeLog Tue Jan 26 22:48:23 2010 -0600 +++ b/src/ChangeLog Tue Jan 26 23:22:30 2010 -0600 @@ -1,3 +1,423 @@ +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. + 2010-01-26 Ben Wing <ben@xemacs.org> * .gdbinit.in.in: Allow an argument to check-xemacs and check-temacs
--- a/src/alloc.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/alloc.c Tue Jan 26 23:22:30 2010 -0600 @@ -2894,8 +2894,14 @@ Lisp_Object build_string (const CIbyte *str) { - /* Some strlen's crash and burn if passed null. */ - return make_string ((const Ibyte *) str, (str ? strlen (str) : 0)); + return build_intstring ((const Ibyte *) str); +} + +Lisp_Object +build_ascstring (const Ascbyte *str) +{ + ASSERT_ASCTEXT_ASCII (str); + return build_intstring ((const Ibyte *) str); } Lisp_Object @@ -2908,16 +2914,64 @@ coding_system); } +/* Build a string whose content is a translatable message, and translate + the message according to the current language environment. */ + Lisp_Object -build_msg_intstring (const Ibyte *str) -{ - return build_intstring (GETTEXT (str)); +build_msg_istring (const Ibyte *str) +{ + return build_intstring (IGETTEXT (str)); +} + +/* Build a string whose content is a translatable message, and translate + the message according to the current language environment. */ + +Lisp_Object +build_msg_cistring (const CIbyte *str) +{ + return build_msg_istring ((const Ibyte *) str); +} + +/* Build a string whose content is a translatable message, and translate + the message according to the current language environment. + String must be pure-ASCII, and when compiled with error-checking, + an abort will have if not pure-ASCII. */ + +Lisp_Object +build_msg_ascstring (const Ascbyte *str) +{ + ASSERT_ASCTEXT_ASCII (str); + return build_msg_istring ((const Ibyte *) str); +} + +/* Build a string whose content is a translatable message, but don't + translate the message immediately. Perhaps do something else instead, + such as put a property on the string indicating that it needs to be + translated. + + This is useful for strings that are built at dump time or init time, + rather than on-the-fly when the current language environment is set + properly. */ + +Lisp_Object +build_defer_istring (const Ibyte *str) +{ + Lisp_Object retval = build_intstring ((Ibyte *) str); + /* Possibly do something to the return value */ + return retval; } Lisp_Object -build_msg_string (const CIbyte *str) -{ - return build_string (CGETTEXT (str)); +build_defer_cistring (const CIbyte *str) +{ + return build_defer_istring ((Ibyte *) str); +} + +Lisp_Object +build_defer_ascstring (const Ascbyte *str) +{ + ASSERT_ASCTEXT_ASCII (str); + return build_defer_istring ((Ibyte *) str); } Lisp_Object @@ -3243,38 +3297,15 @@ #ifdef DEBUG_XEMACS -static const struct memory_description staticpro_one_name_description_1[] = { - { XD_ASCII_STRING, 0 }, - { XD_END } -}; - -static const struct sized_memory_description staticpro_one_name_description = { - sizeof (char *), - staticpro_one_name_description_1 -}; - -static const struct memory_description staticpro_names_description_1[] = { - XD_DYNARR_DESC (char_ptr_dynarr, &staticpro_one_name_description), - { XD_END } -}; - - -extern const struct sized_memory_description staticpro_names_description; - -const struct sized_memory_description staticpro_names_description = { - sizeof (char_ptr_dynarr), - staticpro_names_description_1 -}; - /* Help debug crashes gc-marking a staticpro'ed object. */ Lisp_Object_ptr_dynarr *staticpros; -char_ptr_dynarr *staticpro_names; +const_Ascbyte_ptr_dynarr *staticpro_names; /* Mark the Lisp_Object at non-heap VARADDRESS as a root object for garbage collection, and for dumping. */ void -staticpro_1 (Lisp_Object *varaddress, char *varname) +staticpro_1 (Lisp_Object *varaddress, const Ascbyte *varname) { Dynarr_add (staticpros, varaddress); Dynarr_add (staticpro_names, varname); @@ -3283,19 +3314,19 @@ /* External debugging function: Return the name of the variable at offset COUNT. */ -char * +const Ascbyte * staticpro_name (int count) { return Dynarr_at (staticpro_names, count); } Lisp_Object_ptr_dynarr *staticpros_nodump; -char_ptr_dynarr *staticpro_nodump_names; +const_Ascbyte_ptr_dynarr *staticpro_nodump_names; /* Mark the Lisp_Object at heap VARADDRESS as a root object for garbage collection, but not for dumping. (See below.) */ void -staticpro_nodump_1 (Lisp_Object *varaddress, char *varname) +staticpro_nodump_1 (Lisp_Object *varaddress, const Ascbyte *varname) { Dynarr_add (staticpros_nodump, varaddress); Dynarr_add (staticpro_nodump_names, varname); @@ -3303,7 +3334,7 @@ /* External debugging function: Return the name of the variable at offset COUNT. */ -char * +const Ascbyte * staticpro_nodump_name (int count) { return Dynarr_at (staticpro_nodump_names, count); @@ -3313,7 +3344,7 @@ /* Stop treating the Lisp_Object at non-heap VARADDRESS as a root object for garbage collection, but not for dumping. */ void -unstaticpro_nodump_1 (Lisp_Object *varaddress, char *varname) +unstaticpro_nodump_1 (Lisp_Object *varaddress, const Ascbyte *varname) { Dynarr_delete_object (staticpros, varaddress); Dynarr_delete_object (staticpro_names, varname); @@ -3397,37 +3428,15 @@ #ifdef DEBUG_XEMACS -static const struct memory_description mcpro_one_name_description_1[] = { - { XD_ASCII_STRING, 0 }, - { XD_END } -}; - -static const struct sized_memory_description mcpro_one_name_description = { - sizeof (char *), - mcpro_one_name_description_1 -}; - -static const struct memory_description mcpro_names_description_1[] = { - XD_DYNARR_DESC (char_ptr_dynarr, &mcpro_one_name_description), - { XD_END } -}; - -extern const struct sized_memory_description mcpro_names_description; - -const struct sized_memory_description mcpro_names_description = { - sizeof (char_ptr_dynarr), - mcpro_names_description_1 -}; - /* Help debug crashes gc-marking a mcpro'ed object. */ Lisp_Object_dynarr *mcpros; -char_ptr_dynarr *mcpro_names; +const_Ascbyte_ptr_dynarr *mcpro_names; /* Mark the Lisp_Object at non-heap VARADDRESS as a root object for garbage collection, and for dumping. */ void -mcpro_1 (Lisp_Object varaddress, char *varname) +mcpro_1 (Lisp_Object varaddress, const Ascbyte *varname) { Dynarr_add (mcpros, varaddress); Dynarr_add (mcpro_names, varname); @@ -3435,7 +3444,7 @@ /* External debugging function: Return the name of the variable at offset COUNT. */ -char * +const Ascbyte * mcpro_name (int count) { return Dynarr_at (mcpro_names, count); @@ -4472,8 +4481,8 @@ { if (lrecord_stats[i].instances_in_use != 0) { - char buf [255]; - const char *name = lrecord_implementations_table[i]->name; + Ascbyte buf[255]; + const Ascbyte *name = lrecord_implementations_table[i]->name; int len = strlen (name); if (lrecord_stats[i].bytes_in_use_including_overhead != @@ -4516,8 +4525,8 @@ || lcrecord_stats[i].bytes_freed != 0 || lcrecord_stats[i].instances_on_free_list != 0) { - char buf [255]; - const char *name = lrecord_implementations_table[i]->name; + Ascbyte buf[255]; + const Ascbyte *name = lrecord_implementations_table[i]->name; int len = strlen (name); sprintf (buf, "%s-storage", name); @@ -4959,7 +4968,8 @@ #ifdef DEBUG_XEMACS if (staticpro_nodump_names) Dynarr_free (staticpro_nodump_names); - staticpro_nodump_names = Dynarr_new2 (char_ptr_dynarr, char *); + staticpro_nodump_names = Dynarr_new2 (const_Ascbyte_ptr_dynarr, + const Ascbyte *); Dynarr_resize (staticpro_nodump_names, 100); /* ditto */ #endif @@ -4968,9 +4978,10 @@ Dynarr_resize (mcpros, 1410); /* merely a small optimization */ dump_add_root_block_ptr (&mcpros, &mcpros_description); #ifdef DEBUG_XEMACS - mcpro_names = Dynarr_new2 (char_ptr_dynarr, char *); + mcpro_names = Dynarr_new2 (const_Ascbyte_ptr_dynarr, const Ascbyte *); Dynarr_resize (mcpro_names, 1410); /* merely a small optimization */ - dump_add_root_block_ptr (&mcpro_names, &mcpro_names_description); + dump_add_root_block_ptr (&mcpro_names, + &const_Ascbyte_ptr_dynarr_description_1); #endif #endif /* NEW_GC */ @@ -5063,9 +5074,10 @@ Dynarr_resize (staticpros, 1410); /* merely a small optimization */ dump_add_root_block_ptr (&staticpros, &staticpros_description); #ifdef DEBUG_XEMACS - staticpro_names = Dynarr_new2 (char_ptr_dynarr, char *); + staticpro_names = Dynarr_new2 (const_Ascbyte_ptr_dynarr, const Ascbyte *); Dynarr_resize (staticpro_names, 1410); /* merely a small optimization */ - dump_add_root_block_ptr (&staticpro_names, &staticpro_names_description); + dump_add_root_block_ptr (&staticpro_names, + &const_Ascbyte_ptr_dynarr_description); #endif #ifdef NEW_GC @@ -5073,9 +5085,10 @@ Dynarr_resize (mcpros, 1410); /* merely a small optimization */ dump_add_root_block_ptr (&mcpros, &mcpros_description); #ifdef DEBUG_XEMACS - mcpro_names = Dynarr_new2 (char_ptr_dynarr, char *); + mcpro_names = Dynarr_new2 (const_Ascbyte_ptr_dynarr, const Ascbyte *); Dynarr_resize (mcpro_names, 1410); /* merely a small optimization */ - dump_add_root_block_ptr (&mcpro_names, &mcpro_names_description); + dump_add_root_block_ptr (&mcpro_names, + &const_Ascbyte_ptr_dynarr_description); #endif #else /* not NEW_GC */ init_lcrecord_lists ();
--- a/src/buffer.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/buffer.c Tue Jan 26 23:22:30 2010 -0600 @@ -309,7 +309,7 @@ printing_unreadable_object ("#<buffer %s>", XSTRING_DATA (b->name)); } else if (!BUFFER_LIVE_P (b)) - write_c_string (printcharfun, "#<killed buffer>"); + write_ascstring (printcharfun, "#<killed buffer>"); else if (escapeflag) write_fmt_string_lisp (printcharfun, "#<buffer %S>", 1, b->name); else @@ -1998,8 +1998,8 @@ staticpro (&QSFundamental); staticpro (&QSscratch); - QSFundamental = build_string ("Fundamental"); - QSscratch = build_string (DEFER_GETTEXT ("*scratch*")); + QSFundamental = build_ascstring ("Fundamental"); + QSscratch = build_ascstring ("*scratch*"); DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook /* List of hooks to be run before killing local variables in a buffer. @@ -2258,7 +2258,7 @@ defs->syntax_table = Vstandard_syntax_table; defs->mirror_syntax_table = XCHAR_TABLE (Vstandard_syntax_table)->mirror_table; - defs->modeline_format = build_string ("%-"); /* reset in loaddefs.el */ + defs->modeline_format = build_ascstring ("%-"); /* reset in loaddefs.el */ defs->case_fold_search = Qt; defs->selective_display_ellipses = Qt; defs->tab_width = make_int (8); @@ -2935,7 +2935,7 @@ stderr_out ("`getcwd' failed: %s: changing default directory to %s\n", errmess, DEFAULT_DIRECTORY_FALLBACK); - if (qxe_chdir ((Ibyte *)DEFAULT_DIRECTORY_FALLBACK) < 0) + if (qxe_chdir ((Ibyte *) DEFAULT_DIRECTORY_FALLBACK) < 0) { GET_STRERROR (errmess, errno);
--- a/src/bytecode.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/bytecode.c Tue Jan 26 23:22:30 2010 -0600 @@ -1750,7 +1750,7 @@ DOESNT_RETURN -invalid_byte_code (const CIbyte *reason, Lisp_Object frob) +invalid_byte_code (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qinvalid_byte_code, reason, frob); } @@ -2222,7 +2222,7 @@ struct gcpro gcpro1, gcpro2; GCPRO2 (obj, printcharfun); - write_c_string (printcharfun, print_readably ? "#[" : "#<compiled-function "); + write_ascstring (printcharfun, print_readably ? "#[" : "#<compiled-function "); #ifdef COMPILED_FUNCTION_ANNOTATION_HACK if (!print_readably) { @@ -2235,7 +2235,7 @@ print_internal (compiled_function_arglist (f), printcharfun, escapeflag); /* COMPILED_INSTRUCTIONS = 1 */ - write_c_string (printcharfun, " "); + write_ascstring (printcharfun, " "); { struct gcpro ngcpro1; Lisp_Object instructions = compiled_function_instructions (f); @@ -2252,7 +2252,7 @@ } /* COMPILED_CONSTANTS = 2 */ - write_c_string (printcharfun, " "); + write_ascstring (printcharfun, " "); print_internal (compiled_function_constants (f), printcharfun, escapeflag); /* COMPILED_STACK_DEPTH = 3 */ @@ -2261,7 +2261,7 @@ /* COMPILED_DOC_STRING = 4 */ if (docp || intp) { - write_c_string (printcharfun, " "); + write_ascstring (printcharfun, " "); print_internal (compiled_function_documentation (f), printcharfun, escapeflag); } @@ -2269,13 +2269,13 @@ /* COMPILED_INTERACTIVE = 5 */ if (intp) { - write_c_string (printcharfun, " "); + write_ascstring (printcharfun, " "); print_internal (compiled_function_interactive (f), printcharfun, escapeflag); } UNGCPRO; - write_c_string (printcharfun, print_readably ? "]" : ">"); + write_ascstring (printcharfun, print_readably ? "]" : ">"); }
--- a/src/chartab.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/chartab.c Tue Jan 26 23:22:30 2010 -0600 @@ -314,7 +314,7 @@ struct gcpro gcpro1; Lisp_Object lisprange; if (!a->first) - write_c_string (a->printcharfun, " "); + write_ascstring (a->printcharfun, " "); a->first = 0; lisprange = encode_char_table_range (range); GCPRO1 (lisprange); @@ -338,7 +338,7 @@ write_fmt_string_lisp (printcharfun, "#s(char-table type %s data (", 1, char_table_type_to_symbol (ct->type)); map_char_table (obj, &range, print_table_entry, &arg); - write_c_string (printcharfun, "))"); + write_ascstring (printcharfun, "))"); /* #### need to print and read the default; but that will allow the default to be modified, which we don't (yet) support -- but FSF does */
--- a/src/config.h.in Tue Jan 26 22:48:23 2010 -0600 +++ b/src/config.h.in Tue Jan 26 23:22:30 2010 -0600 @@ -1176,9 +1176,9 @@ aren't using the C++ preprocessor when processing xemacs.def.in.in even if we're using a C++ compiler. I suspect we only need this at all GCC is being used. */ -#if defined (ERROR_CHECK_TYPES) && !defined (USE_GPLUSPLUS) +#if !defined (USE_GPLUSPLUS) /* #if !defined (INLINE_HEADERS_ARE_STATIC) */ -#define NEED_ERROR_CHECK_TYPES_INLINES +#define XEMACS_DEFS_NEEDS_INLINE_DECLS #endif #endif /* _SRC_CONFIG_H_ */
--- a/src/console-gtk.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/console-gtk.c Tue Jan 26 23:22:30 2010 -0600 @@ -60,7 +60,7 @@ return Qnil; else { - connection = build_string ("gtk"); + connection = build_ascstring ("gtk"); } return connection; } @@ -73,7 +73,7 @@ GCPRO1 (connection); - connection = build_string ("gtk"); + connection = build_ascstring ("gtk"); RETURN_UNGCPRO (connection); } @@ -87,7 +87,7 @@ GCPRO2 (connection, hostname); - connection = build_string ("gtk"); + connection = build_ascstring ("gtk"); RETURN_UNGCPRO (connection); } @@ -100,7 +100,7 @@ GCPRO1 (connection); - connection = build_string("gtk"); + connection = build_ascstring("gtk"); RETURN_UNGCPRO (connection); } @@ -112,7 +112,7 @@ struct gcpro gcpro1; GCPRO1 (connection); - connection = build_string("gtk"); + connection = build_ascstring("gtk"); RETURN_UNGCPRO (connection); }
--- a/src/console-stream.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/console-stream.c Tue Jan 26 23:22:30 2010 -0600 @@ -194,7 +194,7 @@ invalid_operation ("Only one frame allowed on stream devices", Qunbound); #endif if (frame_name_is_defaulted) - f->name = build_string ("stream"); + f->name = build_ascstring ("stream"); f->height = 80; f->width = 24; f->visible = 0; /* so redisplay doesn't try to do anything */ @@ -374,7 +374,7 @@ Vterminal_frame = Qnil; /* Moved from console-tty.c */ - Vstdio_str = build_string ("stdio"); + Vstdio_str = build_ascstring ("stdio"); staticpro (&Vstdio_str); }
--- a/src/console-x.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/console-x.c Tue Jan 26 23:22:30 2010 -0600 @@ -202,7 +202,7 @@ /* Check for a couple of standard special cases */ if (string_ichar (connection, 0) == ':') - connection = concat2 (build_string ("localhost"), connection); + connection = concat2 (build_ascstring ("localhost"), connection); else { /* connection =~ s/^unix:/localhost:/; */ @@ -217,7 +217,7 @@ INC_IBYTEPTR (p); } - connection = concat2 (build_string ("localhost:"), + connection = concat2 (build_ascstring ("localhost:"), make_string (p, end - p)); } ok: @@ -277,7 +277,7 @@ &screen_length); if (!screen_length) - connection = concat2 (connection, build_string (".0")); + connection = concat2 (connection, build_ascstring (".0")); RETURN_UNGCPRO (connection); }
--- a/src/console-x.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/console-x.h Tue Jan 26 23:22:30 2010 -0600 @@ -104,7 +104,7 @@ void x_wm_set_cell_size (Widget wmshell, int cw, int ch); void x_wm_set_variable_size (Widget wmshell, int width, int height); -const char *x_event_name (int event_type); +const Ascbyte *x_event_name (int event_type); int check_if_pending_expose_event (struct device *d); int x_error_handler (Display *disp, XErrorEvent *event); void expect_x_error (Display *dpy);
--- a/src/data.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/data.c Tue Jan 26 23:22:30 2010 -0600 @@ -79,13 +79,13 @@ { /* #### It would be really nice if this were a proper warning instead of brain-dead print to Qexternal_debugging_output. */ - write_c_string + write_msg_string (Qexternal_debugging_output, "Comparison between integer and character is constant nil ("); Fprinc (obj1, Qexternal_debugging_output); - write_c_string (Qexternal_debugging_output, " and "); + write_msg_string (Qexternal_debugging_output, " and "); Fprinc (obj2, Qexternal_debugging_output); - write_c_string (Qexternal_debugging_output, ")\n"); + write_msg_string (Qexternal_debugging_output, ")\n"); debug_short_backtrace (debug_ebola_backtrace_length); } return EQ (obj1, obj2); @@ -363,7 +363,7 @@ const CIbyte *prompt; CHECK_SUBR (subr); prompt = XSUBR (subr)->prompt; - return prompt ? list2 (Qinteractive, build_msg_string (prompt)) : Qnil; + return prompt ? list2 (Qinteractive, build_msg_cistring (prompt)) : Qnil; } @@ -1200,44 +1200,44 @@ if (FLOATP (number)) { - char pigbuf[350]; /* see comments in float_to_string */ + Ascbyte pigbuf[350]; /* see comments in float_to_string */ float_to_string (pigbuf, XFLOAT_DATA (number)); - return build_string (pigbuf); + return build_ascstring (pigbuf); } #ifdef HAVE_BIGNUM if (BIGNUMP (number)) { - char *str = bignum_to_string (XBIGNUM_DATA (number), 10); - Lisp_Object retval = build_string (str); - xfree (str, char *); + Ascbyte *str = bignum_to_string (XBIGNUM_DATA (number), 10); + Lisp_Object retval = build_ascstring (str); + xfree (str, Ascbyte *); return retval; } #endif #ifdef HAVE_RATIO if (RATIOP (number)) { - char *str = ratio_to_string (XRATIO_DATA (number), 10); - Lisp_Object retval = build_string (str); - xfree (str, char *); + Ascbyte *str = ratio_to_string (XRATIO_DATA (number), 10); + Lisp_Object retval = build_ascstring (str); + xfree (str, Ascbyte *); return retval; } #endif #ifdef HAVE_BIGFLOAT if (BIGFLOATP (number)) { - char *str = bigfloat_to_string (XBIGFLOAT_DATA (number), 10); - Lisp_Object retval = build_string (str); - xfree (str, char *); + Ascbyte *str = bigfloat_to_string (XBIGFLOAT_DATA (number), 10); + Lisp_Object retval = build_ascstring (str); + xfree (str, Ascbyte *); return retval; } #endif { - char buffer[DECIMAL_PRINT_SIZE (long)]; + Ascbyte buffer[DECIMAL_PRINT_SIZE (long)]; long_to_string (buffer, XINT (number)); - return build_string (buffer); + return build_ascstring (buffer); } }
--- a/src/device-gtk.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/device-gtk.c Tue Jan 26 23:22:30 2010 -0600 @@ -236,7 +236,7 @@ /* Attempt to load a site-specific gtkrc */ { - Lisp_Object gtkrc = Fexpand_file_name (build_string ("gtkrc"), Vdata_directory); + Lisp_Object gtkrc = Fexpand_file_name (build_ascstring ("gtkrc"), Vdata_directory); gchar **default_files = gtk_rc_get_default_files (); gint num_files;
--- a/src/device-msw.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/device-msw.c Tue Jan 26 23:22:30 2010 -0600 @@ -1155,7 +1155,7 @@ Lisp_Devmode *dm = XDEVMODE (obj); if (print_readably) printing_unreadable_lcrecord (obj, 0); - write_c_string (printcharfun, "#<msprinter-settings"); + write_ascstring (printcharfun, "#<msprinter-settings"); if (!NILP (dm->printer_name)) write_fmt_string_lisp (printcharfun, " for %S", 1, dm->printer_name); if (!NILP (dm->device))
--- a/src/device-x.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/device-x.c Tue Jan 26 23:22:30 2010 -0600 @@ -1005,10 +1005,10 @@ /* handle X errors */ /************************************************************************/ -const char * +const Ascbyte * x_event_name (int event_type) { - static const char *events[] = + static const Ascbyte *events[] = { "0: ERROR!", "1: REPLY",
--- a/src/dialog-msw.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/dialog-msw.c Tue Jan 26 23:22:30 2010 -0600 @@ -394,7 +394,7 @@ BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_EDITBOX | BIF_NEWDIALOGSTYLE; bi.lpfn = handle_directory_proc; - LISP_LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil), + LISP_LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_ascstring (""), Qnil), pd.fname); { @@ -468,7 +468,7 @@ ofn.nMaxFile = sizeof (fnbuf) / XETCHAR_SIZE; qxetcscpy (fnbuf, XETEXT ("")); - LISP_LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil), + LISP_LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_ascstring (""), Qnil), ofn.lpstrInitialDir); { @@ -844,9 +844,9 @@ &Vdefault_file_dialog_filter_alist /* */ ); Vdefault_file_dialog_filter_alist = - list5 (Fcons (build_msg_string ("Text Files"), build_string ("*.txt")), - Fcons (build_msg_string ("C Files"), build_string ("*.c;*.h")), - Fcons (build_msg_string ("Elisp Files"), build_string ("*.el")), - Fcons (build_msg_string ("HTML Files"), build_string ("*.html;*.html")), - Fcons (build_msg_string ("All Files"), build_string ("*.*"))); + list5 (Fcons (build_defer_string ("Text Files"), build_ascstring ("*.txt")), + Fcons (build_defer_string ("C Files"), build_ascstring ("*.c;*.h")), + Fcons (build_defer_string ("Elisp Files"), build_ascstring ("*.el")), + Fcons (build_defer_string ("HTML Files"), build_ascstring ("*.html;*.html")), + Fcons (build_defer_string ("All Files"), build_ascstring ("*.*"))); }
--- a/src/doc.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/doc.c Tue Jan 26 23:22:30 2010 -0600 @@ -491,12 +491,13 @@ static void -weird_doc (Lisp_Object sym, const CIbyte *weirdness, const CIbyte *type, +weird_doc (Lisp_Object sym, const Ascbyte *weirdness, const Ascbyte *type, int pos) { - if (!strcmp (weirdness, GETTEXT ("duplicate"))) return; + if (!strcmp (weirdness, "duplicate")) return; message ("Note: Strange doc (%s) for %s %s @ %d", - weirdness, type, XSTRING_DATA (XSYMBOL (sym)->name), pos); + GETTEXT (weirdness), GETTEXT (type), + XSTRING_DATA (XSYMBOL (sym)->name), pos); } DEFUN ("built-in-symbol-file", Fbuilt_in_symbol_file, 1, 2, 0, /* @@ -789,8 +790,8 @@ Lisp_Object old = Fget (sym, Qvariable_documentation, Qzero); if (!ZEROP (old)) { - weird_doc (sym, GETTEXT ("duplicate"), - GETTEXT ("variable"), pos); + weird_doc (sym, "duplicate", + "variable", pos); /* In the case of duplicate doc file entries, always take the later one. But if the doc is not an int (a string, say) leave it alone. */ @@ -830,8 +831,8 @@ So I'm disabling this. --ben */ /* May have been #if'ed out or something */ - weird_doc (sym, GETTEXT ("not fboundp"), - GETTEXT ("function"), pos); + weird_doc (sym, "not fboundp", + "function", pos); #endif goto weird; } @@ -840,8 +841,8 @@ /* Lisp_Subrs have a slot for it. */ if (XSUBR (fun)->doc) { - weird_doc (sym, GETTEXT ("duplicate"), - GETTEXT ("subr"), pos); + weird_doc (sym, "duplicate", + "subr", pos); goto weird; } XSUBR (fun)->doc = (char *) (- XINT (offset)); @@ -859,11 +860,12 @@ Lisp_Object old = XCAR (tem); if (!ZEROP (old)) { - weird_doc (sym, GETTEXT ("duplicate"), - (EQ (tem, Qlambda) - ? GETTEXT ("lambda") - : GETTEXT ("autoload")), - pos); + if (EQ (tem, Qlambda)) + weird_doc (sym, "duplicate", "lambda", + pos); + else + weird_doc (sym, "duplicate", "autoload", + pos); /* In the case of duplicate doc file entries, always take the later one. But if the doc is not an int (a string, say) leave it @@ -875,24 +877,23 @@ } else if (!CONSP (tem)) { - weird_doc (sym, GETTEXT ("!CONSP(tem)"), - GETTEXT ("function"), pos); + weird_doc (sym, "!CONSP(tem)", "function", pos); goto cont; } else { /* DOC string is a string not integer 0 */ #if 0 - weird_doc (sym, GETTEXT ("!INTP(XCAR(tem))"), - GETTEXT ("function"), pos); + weird_doc (sym, "!INTP(XCAR(tem))", + "function", pos); #endif goto cont; } } else { - weird_doc (sym, GETTEXT ("not lambda or autoload"), - GETTEXT ("function"), pos); + weird_doc (sym, "not lambda or autoload", + "function", pos); goto cont; } } @@ -911,8 +912,7 @@ if (! (f->flags.documentationp)) { - weird_doc (sym, GETTEXT ("no doc slot"), - GETTEXT ("bytecode"), pos); + weird_doc (sym, "no doc slot", "bytecode", pos); goto weird; } else @@ -921,8 +921,7 @@ compiled_function_documentation (f); if (!ZEROP (old)) { - weird_doc (sym, GETTEXT ("duplicate"), - GETTEXT ("bytecode"), pos); + weird_doc (sym, "duplicate", "bytecode", pos); /* In the case of duplicate doc file entries, always take the later one. But if the doc is not an int (a string, say) leave it alone. */ @@ -936,8 +935,7 @@ { /* Otherwise the function is undefined or otherwise weird. Ignore it. */ - weird_doc (sym, GETTEXT ("weird function"), - GETTEXT ("function"), pos); + weird_doc (sym, "weird function", "function", pos); goto weird; } } @@ -1315,6 +1313,6 @@ */ ); Vinternal_doc_file_name = Qnil; - QSsubstitute = build_string (" *substitute*"); + QSsubstitute = build_ascstring (" *substitute*"); staticpro (&QSsubstitute); }
--- a/src/dumper.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/dumper.c Tue Jan 26 23:22:30 2010 -0600 @@ -2123,11 +2123,11 @@ O_WRONLY | O_CREAT | O_TRUNC | OPEN_BINARY, 0666); if (pdump_fd < 0) report_file_error ("Unable to open dump file", - build_string (EMACS_PROGNAME ".dmp")); + build_ascstring (EMACS_PROGNAME ".dmp")); pdump_out = fdopen (pdump_fd, "w"); if (pdump_out < 0) report_file_error ("Unable to open dump file for writing", - build_string (EMACS_PROGNAME ".dmp")); + build_ascstring (EMACS_PROGNAME ".dmp")); retry_fwrite (&header, sizeof (header), 1, pdump_out); PDUMP_ALIGN_OUTPUT (max_align_t);
--- a/src/dynarr.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/dynarr.c Tue Jan 26 23:22:30 2010 -0600 @@ -1,6 +1,6 @@ /* Support for dynamic arrays. Copyright (C) 1993 Sun Microsystems, Inc. - Copyright (C) 2002, 2003, 2004, 2005 Ben Wing. + Copyright (C) 2002, 2003, 2004, 2005, 2010 Ben Wing. This file is part of XEmacs. @@ -127,6 +127,27 @@ #include <config.h> #include "lisp.h" +static const struct memory_description const_Ascbyte_ptr_description_1[] = { + { XD_ASCII_STRING, 0 }, + { XD_END } +}; + +const struct sized_memory_description const_Ascbyte_ptr_description = { + sizeof (const Ascbyte *), + const_Ascbyte_ptr_description_1 +}; + +static const struct memory_description const_Ascbyte_ptr_dynarr_description_1[] = { + XD_DYNARR_DESC (const_Ascbyte_ptr_dynarr, &const_Ascbyte_ptr_description), + { XD_END } +}; + +const struct sized_memory_description const_Ascbyte_ptr_dynarr_description = { + sizeof (const_Ascbyte_ptr_dynarr), + const_Ascbyte_ptr_dynarr_description_1 +}; + + static int Dynarr_min_size = 8; static void
--- a/src/editfns.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/editfns.c Tue Jan 26 23:22:30 2010 -0600 @@ -744,7 +744,7 @@ struct passwd *pw = qxe_getpwuid (getuid ()); /* #### - I believe this should return nil instead of "unknown" when pw==0 */ - return build_string (pw ? pw->pw_name : "unknown"); + return build_ext_string (pw ? pw->pw_name : "unknown", Quser_name_encoding); } DEFUN ("user-uid", Fuser_uid, 0, 0, 0, /* @@ -869,7 +869,7 @@ We probably should try to extract pw_dir from /etc/passwd, before falling back to this. */ cached_home_directory - = qxestrdup ((const Ibyte *)DEFAULT_DIRECTORY_FALLBACK); + = qxestrdup ((const Ibyte *) DEFAULT_DIRECTORY_FALLBACK); output_home_warning = 1; } }
--- a/src/elhash.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/elhash.c Tue Jan 26 23:22:30 2010 -0600 @@ -330,16 +330,16 @@ int count = 0; htentry *e, *sentinel; - write_c_string (printcharfun, " :data ("); + write_ascstring (printcharfun, " :data ("); for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++) if (!HTENTRY_CLEAR_P (e)) { if (count > 0) - write_c_string (printcharfun, " "); + write_ascstring (printcharfun, " "); if (!print_readably && count > 3) { - write_c_string (printcharfun, "..."); + write_ascstring (printcharfun, "..."); break; } print_internal (e->key, printcharfun, 1); @@ -347,7 +347,7 @@ count++; } - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); } static void @@ -357,16 +357,16 @@ Lisp_Hash_Table *ht = XHASH_TABLE (obj); Ascbyte pigbuf[350]; - write_c_string (printcharfun, + write_ascstring (printcharfun, print_readably ? "#s(hash-table" : "#<hash-table"); /* These checks have a kludgy look to them, but they are safe. Due to nature of hashing, you cannot use arbitrary test functions anyway. */ if (!ht->test_function) - write_c_string (printcharfun, " :test eq"); + write_ascstring (printcharfun, " :test eq"); else if (ht->test_function == lisp_object_equal_equal) - write_c_string (printcharfun, " :test equal"); + write_ascstring (printcharfun, " :test equal"); else if (ht->test_function == lisp_object_eql_equal) DO_NOTHING; else @@ -410,7 +410,7 @@ print_hash_table_data (ht, printcharfun); if (print_readably) - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); else write_fmt_string (printcharfun, " 0x%x>", ht->header.uid); }
--- a/src/emacs.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/emacs.c Tue Jan 26 23:22:30 2010 -0600 @@ -2012,6 +2012,7 @@ - make_string() - build_intstring() - build_string() + - build_ascstring() - make_vector() - make_int() - make_char() @@ -4208,7 +4209,7 @@ DEFVAR_LISP ("system-configuration", &Vsystem_configuration /* String naming the configuration XEmacs was built for. */ ); - Vsystem_configuration = build_string (EMACS_CONFIGURATION); + Vsystem_configuration = build_ascstring (EMACS_CONFIGURATION); #ifndef EMACS_CONFIG_OPTIONS # define EMACS_CONFIG_OPTIONS "UNKNOWN" @@ -4216,7 +4217,7 @@ DEFVAR_LISP ("system-configuration-options", &Vsystem_configuration_options /* String containing the configuration options XEmacs was built with. */ ); - Vsystem_configuration_options = build_string (EMACS_CONFIG_OPTIONS); + Vsystem_configuration_options = build_ascstring (EMACS_CONFIG_OPTIONS); DEFVAR_LISP ("emacs-major-version", &Vemacs_major_version /* Major version number of this version of Emacs, as an integer. @@ -4282,7 +4283,7 @@ #ifndef XEMACS_CODENAME #define XEMACS_CODENAME "Noname" #endif - Vxemacs_codename = build_string (XEMACS_CODENAME); + Vxemacs_codename = build_ascstring (XEMACS_CODENAME); DEFVAR_LISP ("xemacs-extra-name", &Vxemacs_extra_name /* Arbitrary string to place in the version string after the codename. @@ -4295,7 +4296,7 @@ to indicate particular branches, etc. */ ); #ifdef XEMACS_EXTRA_NAME - Vxemacs_extra_name = build_string (XEMACS_EXTRA_NAME); + Vxemacs_extra_name = build_ascstring (XEMACS_EXTRA_NAME); #endif DEFVAR_LISP ("xemacs-release-date", &Vxemacs_release_date /* @@ -4307,7 +4308,7 @@ #ifndef XEMACS_RELEASE_DATE #define XEMACS_RELEASE_DATE "2005-02-18 (defaulted in emacs.c)" #endif - Vxemacs_release_date = build_string (XEMACS_RELEASE_DATE); + Vxemacs_release_date = build_ascstring (XEMACS_RELEASE_DATE); /* Lisp variables which contain command line flags.
--- a/src/emodules.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/emodules.c Tue Jan 26 23:22:30 2010 -0600 @@ -1,5 +1,6 @@ /* emodules.c - Support routines for dynamic module loading (C) Copyright 1998, 1999 J. Kean Johnston. All rights reserved. +(C) Copyright 2010 Ben Wing. This file is part of XEmacs. @@ -18,6 +19,8 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* This file has been Mule-ized, Ben Wing, 1-26-10. */ + #include "emodules.h" #include "sysdll.h" #ifdef HAVE_LTDL @@ -48,11 +51,11 @@ typedef struct _emodules_list { int used; /* Is this slot used? */ - CIbyte *soname; /* Name of the shared object loaded (full path) */ - CIbyte *modname; /* The name of the module */ - CIbyte *modver; /* The module version string */ - CIbyte *modtitle; /* How the module announces itself */ - void (*unload)(void); /* Module cleanup function to run before unloading */ + Ibyte *soname; /* Name of the shared object loaded (full path) */ + Ibyte *modname; /* The name of the module */ + Ibyte *modver; /* The module version string */ + Ibyte *modtitle; /* How the module announces itself */ + void (*unload) (void);/* Module cleanup function to run before unloading */ dll_handle dlhandle; /* Dynamic lib handle */ } emodules_list; @@ -61,8 +64,8 @@ static emodules_list *modules; static int modnum; -static int find_make_module (const CIbyte *mod, const CIbyte *name, - const CIbyte *ver, int make_or_find); +static int find_make_module (Lisp_Object mod, const Ibyte *name, + const Ibyte *ver, int make_or_find); static Lisp_Object module_load_unwind (Lisp_Object); static void attempt_module_delete (int mod); @@ -96,22 +99,22 @@ */ (file, name, version)) { - const CIbyte *mod, *mname, *mver; + const Ibyte *mod, *mname, *mver; int speccount = specpdl_depth(); - CHECK_STRING(file); + CHECK_STRING (file); - mod = (CIbyte *) XSTRING_DATA (file); + mod = XSTRING_DATA (file); if (NILP (name)) - mname = ""; + mname = (const Ibyte *) ""; else - mname = (CIbyte *) XSTRING_DATA (name); + mname = XSTRING_DATA (name); if (NILP (version)) - mver = ""; + mver = (const Ibyte *) ""; else - mver = (CIbyte *) XSTRING_DATA (version); + mver = XSTRING_DATA (version); dlhandle = 0; record_unwind_protect (module_load_unwind, make_int(modnum)); @@ -136,7 +139,7 @@ (file, name, version)) { int x; - const CIbyte *mod, *mname, *mver; + const Ibyte *mname, *mver; Lisp_Object foundname = Qnil; struct gcpro gcpro1; @@ -146,20 +149,19 @@ if (locate_file (Vmodule_load_path, file, Vmodule_extensions, &foundname, 0) < 0) return Qt; - mod = (CIbyte *) XSTRING_DATA (foundname); UNGCPRO; if (NILP (name)) - mname = ""; + mname = (const Ibyte *) ""; else - mname = (CIbyte *) XSTRING_DATA (name); + mname = XSTRING_DATA (name); if (NILP (version)) - mver = ""; + mver = (const Ibyte *) ""; else - mver = (CIbyte *) XSTRING_DATA (version); + mver = XSTRING_DATA (version); - x = find_make_module (mod, mname, mver, 1); + x = find_make_module (foundname, mname, mver, 1); if (x != -1) { if (modules[x].unload != NULL) @@ -199,30 +201,31 @@ for (i = 0; i < modnum; i++) { if (modules[i].used == 1) - mlist = Fcons (list4 (build_string (modules[i].soname), - build_string (modules[i].modname), - build_string (modules[i].modver), - build_string (modules[i].modtitle)), mlist); + mlist = Fcons (list4 (build_intstring (modules[i].soname), + build_intstring (modules[i].modname), + build_intstring (modules[i].modver), + build_intstring (modules[i].modtitle)), mlist); } return mlist; } static int -find_make_module (const CIbyte *mod, const CIbyte *name, const CIbyte *ver, +find_make_module (Lisp_Object mod, const Ibyte *name, const Ibyte *ver, int mof) { int i, fs = -1; + Ibyte *modstr = XSTRING_DATA (mod); for (i = 0; i < modnum; i++) { if (fs == -1 && modules[i].used == 0) fs = i; - if (strcmp (modules[i].soname, mod) == 0) + if (qxestrcmp (modules[i].soname, modstr) == 0) { - if (name && name[0] && strcmp (modules[i].modname, name)) + if (name && name[0] && qxestrcmp (modules[i].modname, name)) continue; - if (ver && ver[0] && strcmp (modules[i].modver, ver)) + if (ver && ver[0] && qxestrcmp (modules[i].modver, ver)) continue; return i; /* Found a match */ } @@ -253,10 +256,10 @@ { if (dll_close (modules[mod].dlhandle) == 0) { - xfree (modules[mod].soname, CIbyte *); - xfree (modules[mod].modname, CIbyte *); - xfree (modules[mod].modver, CIbyte *); - xfree (modules[mod].modtitle, CIbyte *); + xfree (modules[mod].soname, Ibyte *); + xfree (modules[mod].modname, Ibyte *); + xfree (modules[mod].modver, Ibyte *); + xfree (modules[mod].modtitle, Ibyte *); modules[mod].dlhandle = 0; modules[mod].used = 0; } @@ -330,18 +333,16 @@ * the cleaning up. */ void -emodules_load (const CIbyte *module, const CIbyte *modname, - const CIbyte *modver) +emodules_load (const Ibyte *module, const Ibyte *modname, + const Ibyte *modver) { - /* !!#### Needs serious work */ Lisp_Object old_load_list; Lisp_Object filename; Lisp_Object foundname, lisp_modname; int x, mpx; - CIbyte *soname; - const CIbyte **f; + const Extbyte **f; const long *ellcc_rev; - CIbyte *mver, *mname, *mtitle, *symname; + Ibyte *mver, *mname, *mtitle, *symname; void (*modload)(void) = 0; void (*modsyms)(void) = 0; void (*modvars)(void) = 0; @@ -359,13 +360,12 @@ if (module == NULL || module[0] == '\0') invalid_argument ("Empty module name", Qunbound); - GCPRO4(filename, foundname, old_load_list, lisp_modname); - filename = build_string (module); + GCPRO4 (filename, foundname, old_load_list, lisp_modname); + filename = build_intstring (module); if (locate_file (Vmodule_load_path, filename, Vmodule_extensions, &foundname, 0) < 0) signal_error (Qdll_error, "Cannot open dynamic module", filename); - LISP_STRING_TO_EXTERNAL (foundname, soname, Qfile_name); lisp_modname = call1 (Qfile_name_sans_extension, Ffile_name_nondirectory (foundname)); @@ -375,76 +375,83 @@ signal_error (Qdll_error, "Opening dynamic module", dll_error ()); } - ellcc_rev = (const long *)dll_variable (dlhandle, "emodule_compiler"); + ellcc_rev = (const long *) dll_variable (dlhandle, "emodule_compiler"); if (ellcc_rev == NULL || *ellcc_rev <= 0L) signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_compiler'", Qunbound); if (*ellcc_rev > EMODULES_REVISION) signal_ferror (Qdll_error, "Invalid dynamic module: Unsupported version `%ld(%ld)'", *ellcc_rev, EMODULES_REVISION); - f = (const CIbyte **) dll_variable (dlhandle, "emodule_name"); + f = (const Extbyte **) dll_variable (dlhandle, "emodule_name"); if (f == NULL || *f == NULL) signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_name'", Qunbound); - mname = (CIbyte *) ALLOCA (strlen (*f) + 1); - strcpy (mname, *f); + mname = NEW_EXTERNAL_TO_C_STRING (f, Qemodule_string_encoding); + /* #### Not obvious we have to force an alloca copy here, but the old + code did so */ + IBYTE_STRING_TO_ALLOCA (mname, mname); + if (mname[0] == '\0') signal_error (Qdll_error, "Invalid dynamic module: Empty value for `emodule_name'", Qunbound); - f = (const CIbyte **) dll_variable (dlhandle, "emodule_version"); + f = (const Extbyte **) dll_variable (dlhandle, "emodule_version"); if (f == NULL || *f == NULL) signal_error (Qdll_error, "Missing symbol `emodule_version': Invalid dynamic module", Qunbound); - mver = (CIbyte *) ALLOCA (strlen (*f) + 1); - strcpy (mver, *f); + mver = NEW_EXTERNAL_TO_C_STRING (f, Qemodule_string_encoding); + /* #### Not obvious we have to force an alloca copy here, but the old + code did so */ + IBYTE_STRING_TO_ALLOCA (mver, mver); - f = (const CIbyte **) dll_variable (dlhandle, "emodule_title"); + f = (const Extbyte **) dll_variable (dlhandle, "emodule_title"); if (f == NULL || *f == NULL) signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_title'", Qunbound); - mtitle = (CIbyte *) ALLOCA (strlen (*f) + 1); - strcpy (mtitle, *f); + mtitle = NEW_EXTERNAL_TO_C_STRING (f, Qemodule_string_encoding); + /* #### Not obvious we have to force an alloca copy here, but the old + code did so */ + IBYTE_STRING_TO_ALLOCA (mtitle, mtitle); - symname = (CIbyte *) ALLOCA (strlen (mname) + 15); + symname = alloca_ibytes (qxestrlen (mname) + 15); - strcpy (symname, "modules_of_"); - strcat (symname, mname); - modload = (void (*)(void))dll_function (dlhandle, symname); + qxestrcpy_ascii (symname, "modules_of_"); + qxestrcat (symname, mname); + modload = (void (*)(void)) dll_function (dlhandle, symname); /* * modload is optional. If the module doesn't require other modules it can * be left out. */ - strcpy (symname, "syms_of_"); - strcat (symname, mname); - modsyms = (void (*)(void))dll_function (dlhandle, symname); + qxestrcpy_ascii (symname, "syms_of_"); + qxestrcat (symname, mname); + modsyms = (void (*)(void)) dll_function (dlhandle, symname); if (modsyms == NULL) { missing_symbol: signal_error (Qdll_error, "Invalid dynamic module: Missing symbol", - build_string (symname)); + build_intstring (symname)); } - strcpy (symname, "vars_of_"); - strcat (symname, mname); - modvars = (void (*)(void))dll_function (dlhandle, symname); + qxestrcpy_ascii (symname, "vars_of_"); + qxestrcat (symname, mname); + modvars = (void (*)(void)) dll_function (dlhandle, symname); if (modvars == NULL) goto missing_symbol; - strcpy (symname, "docs_of_"); - strcat (symname, mname); - moddocs = (void (*)(void))dll_function (dlhandle, symname); + qxestrcpy_ascii (symname, "docs_of_"); + qxestrcat (symname, mname); + moddocs = (void (*)(void)) dll_function (dlhandle, symname); if (moddocs == NULL) goto missing_symbol; /* Now look for the optional unload function. */ - strcpy (symname, "unload_"); - strcat (symname, mname); - modunld = (void (*)(void))dll_function (dlhandle, symname); + qxestrcpy_ascii (symname, "unload_"); + qxestrcat (symname, mname); + modunld = (void (*)(void)) dll_function (dlhandle, symname); - if (modname && modname[0] && strcmp (modname, mname)) + if (modname && modname[0] && qxestrcmp (modname, mname)) signal_error (Qdll_error, "Module name mismatch", Qunbound); - if (modver && modver[0] && strcmp (modver, mver)) + if (modver && modver[0] && qxestrcmp (modver, mver)) signal_error (Qdll_error, "Module version mismatch", Qunbound); /* @@ -453,7 +460,7 @@ * If that is non-zero, we know that we have a previously loaded module * of the same name and version, and we don't need to go any further. */ - mpx = find_make_module (soname, mname, mver, 0); + mpx = find_make_module (foundname, mname, mver, 0); mp = &modules[mpx]; if (mp->used > 0) { @@ -471,10 +478,10 @@ * module to the list of modules. */ mp->used = emodules_depth + 1; - mp->soname = xstrdup (soname); - mp->modname = xstrdup (mname); - mp->modver = xstrdup (mver); - mp->modtitle = xstrdup (mtitle); + mp->soname = qxestrdup (XSTRING_DATA (foundname)); + mp->modname = qxestrdup (mname); + mp->modver = qxestrdup (mver); + mp->modtitle = qxestrdup (mtitle); mp->dlhandle = dlhandle; mp->unload = modunld; dlhandle = 0; @@ -489,15 +496,15 @@ * startup tasks. */ if (modload != 0) - (*modload)(); + (*modload) (); /* * Now we can get the module to initialize its symbols, and then its * variables, and lastly the documentation strings. */ - (*modsyms)(); - (*modvars)(); - (*moddocs)(); + (*modsyms) (); + (*modvars) (); + (*moddocs) (); if (!load_modules_quietly) message ("Loaded module %s v%s (%s)", mname, mver, mtitle); @@ -521,10 +528,10 @@ } void -emodules_doc_subr(const char *symname, const char *doc) +emodules_doc_subr (const Ibyte *symname, const Ibyte *doc) { - Bytecount len = strlen (symname); - Lisp_Object sym = oblookup (Vobarray, (const Ibyte *)symname, len); + Bytecount len = qxestrlen (symname); + Lisp_Object sym = oblookup (Vobarray, symname, len); Lisp_Subr *subr; /* Skip autoload cookies */ @@ -534,7 +541,7 @@ subr->doc = xstrdup (doc); } /* - * FIXME: I wish there was some way to avoid the xstrdup(). Is it + * #### FIXME: I wish there was some way to avoid the xstrdup(). Is it * possible to just set a pointer to the string, or somehow create a * symbol whose value we can point to the constant string? Can someone * look into this? @@ -542,17 +549,17 @@ } void -emodules_doc_sym (const char *symname, const char *doc) +emodules_doc_sym (const Ibyte *symname, const Ibyte *doc) { - Bytecount len = strlen (symname); - Lisp_Object sym = oblookup (Vobarray, (const Ibyte *)symname, len); + Bytecount len = qxestrlen (symname); + Lisp_Object sym = oblookup (Vobarray, symname, len); Lisp_Object docstr; struct gcpro gcpro1; - if (SYMBOLP(sym)) + if (SYMBOLP (sym)) { - docstr = build_string (doc); - GCPRO1(docstr); + docstr = build_intstring (doc); + GCPRO1 (docstr); Fput (sym, Qvariable_documentation, docstr); UNGCPRO; } @@ -565,9 +572,9 @@ DEFERROR_STANDARD (Qdll_error, Qerror); DEFSYMBOL (Qmodule); DEFSYMBOL (Qunload_module); - DEFSUBR(Fload_module); - DEFSUBR(Flist_modules); - DEFSUBR(Funload_module); + DEFSUBR (Fload_module); + DEFSUBR (Flist_modules); + DEFSUBR (Funload_module); module_tag = Fcons (Qmodule, Qnil); staticpro (&module_tag); Fput (Qunload_module, Qdisabled, Qt); @@ -651,9 +658,9 @@ DEFVAR_LISP ("module-extensions", &Vmodule_extensions /* *List of filename extensions to use when searching for dynamic modules. */); - Vmodule_extensions = list5 (build_string (".ell"), - build_string (".so"), - build_string (".dll"), - build_string (".dylib"), - build_string ("")); + Vmodule_extensions = list5 (build_ascstring (".ell"), + build_ascstring (".so"), + build_ascstring (".dll"), + build_ascstring (".dylib"), + build_ascstring ("")); }
--- a/src/emodules.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/emodules.h Tue Jan 26 23:22:30 2010 -0600 @@ -59,7 +59,8 @@ * specified version before. We also use these as checks when we open the * module to make sure we have the right module. */ -extern void emodules_load (const char *module, const char *name, const char *version); +extern void emodules_load (const Ibyte *module, const Ibyte *modname, + const Ibyte *modver); /* * Because subrs and symbols added by a dynamic module are not part of @@ -70,10 +71,10 @@ * into the right place. These functions will be called by the module * init code, generated by ellcc during initialization mode. */ -EXTERN_C MODULE_API void emodules_doc_subr (const char *objname, - const char *docstr); -EXTERN_C MODULE_API void emodules_doc_sym (const char *objname, - const char *docstr); +EXTERN_C MODULE_API void emodules_doc_subr (const Ibyte *objname, + const Ibyte *docstr); +EXTERN_C MODULE_API void emodules_doc_sym (const Ibyte *objname, + const Ibyte *docstr); #define CDOCSUBR(Fname, DOC) emodules_doc_subr (Fname, DOC) #define CDOCSYM(Sname, DOC) emodules_doc_sym (Sname, DOC)
--- a/src/eval.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/eval.c Tue Jan 26 23:22:30 2010 -0600 @@ -426,17 +426,17 @@ print_subr (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) { Lisp_Subr *subr = XSUBR (obj); - const CIbyte *header = + const Ascbyte *header = (subr->max_args == UNEVALLED) ? "#<special-form " : "#<subr "; - const CIbyte *name = subr_name (subr); - const CIbyte *trailer = subr->prompt ? " (interactive)>" : ">"; + const Ascbyte *name = subr_name (subr); + const Ascbyte *trailer = subr->prompt ? " (interactive)>" : ">"; if (print_readably) printing_unreadable_object ("%s%s%s", header, name, trailer); - write_c_string (printcharfun, header); - write_c_string (printcharfun, name); - write_c_string (printcharfun, trailer); + write_ascstring (printcharfun, header); + write_ascstring (printcharfun, name); + write_ascstring (printcharfun, trailer); } static const struct memory_description subr_description[] = { @@ -738,7 +738,7 @@ specbind (Qstack_trace_on_signal, Qnil); if (!noninteractive) - internal_with_output_to_temp_buffer (build_string ("*Backtrace*"), + internal_with_output_to_temp_buffer (build_ascstring ("*Backtrace*"), backtrace_259, Qnil, Qnil); @@ -780,7 +780,7 @@ specbind (Qstack_trace_on_signal, Qnil); if (!noninteractive) - internal_with_output_to_temp_buffer (build_string ("*Backtrace*"), + internal_with_output_to_temp_buffer (build_ascstring ("*Backtrace*"), backtrace_259, Qnil, Qnil); @@ -2654,7 +2654,7 @@ to signal_error_1(). */ Lisp_Object -build_error_data (const CIbyte *reason, Lisp_Object frob) +build_error_data (const Ascbyte *reason, Lisp_Object frob) { if (EQ (frob, Qunbound)) frob = Qnil; @@ -2669,13 +2669,13 @@ } DOESNT_RETURN -signal_error (Lisp_Object type, const CIbyte *reason, Lisp_Object frob) +signal_error (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob) { signal_error_1 (type, build_error_data (reason, frob)); } void -maybe_signal_error (Lisp_Object type, const CIbyte *reason, +maybe_signal_error (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { @@ -2686,14 +2686,14 @@ } Lisp_Object -signal_continuable_error (Lisp_Object type, const CIbyte *reason, +signal_continuable_error (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob) { return Fsignal (type, build_error_data (reason, frob)); } Lisp_Object -maybe_signal_continuable_error (Lisp_Object type, const CIbyte *reason, +maybe_signal_continuable_error (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { @@ -2715,7 +2715,7 @@ but these are more convenient in this particular case.) */ DOESNT_RETURN -signal_error_2 (Lisp_Object type, const CIbyte *reason, +signal_error_2 (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob0, Lisp_Object frob1) { signal_error_1 (type, list3 (build_msg_string (reason), frob0, @@ -2723,7 +2723,7 @@ } void -maybe_signal_error_2 (Lisp_Object type, const CIbyte *reason, +maybe_signal_error_2 (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob0, Lisp_Object frob1, Lisp_Object class_, Error_Behavior errb) { @@ -2735,7 +2735,7 @@ } Lisp_Object -signal_continuable_error_2 (Lisp_Object type, const CIbyte *reason, +signal_continuable_error_2 (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob0, Lisp_Object frob1) { return Fsignal (type, list3 (build_msg_string (reason), frob0, @@ -2743,7 +2743,7 @@ } Lisp_Object -maybe_signal_continuable_error_2 (Lisp_Object type, const CIbyte *reason, +maybe_signal_continuable_error_2 (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob0, Lisp_Object frob1, Lisp_Object class_, Error_Behavior errb) { @@ -2763,13 +2763,13 @@ is a single string, created using the arguments. */ DOESNT_RETURN -signal_ferror (Lisp_Object type, const CIbyte *fmt, ...) +signal_ferror (Lisp_Object type, const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -2778,7 +2778,7 @@ void maybe_signal_ferror (Lisp_Object type, Lisp_Object class_, Error_Behavior errb, - const CIbyte *fmt, ...) + const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; @@ -2788,7 +2788,7 @@ return; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -2796,13 +2796,13 @@ } Lisp_Object -signal_continuable_ferror (Lisp_Object type, const CIbyte *fmt, ...) +signal_continuable_ferror (Lisp_Object type, const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -2811,7 +2811,7 @@ Lisp_Object maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class_, - Error_Behavior errb, const CIbyte *fmt, ...) + Error_Behavior errb, const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; @@ -2821,7 +2821,7 @@ return Qnil; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -2844,14 +2844,14 @@ */ DOESNT_RETURN -signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const CIbyte *fmt, +signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -2861,7 +2861,7 @@ void maybe_signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb, - const CIbyte *fmt, ...) + const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; @@ -2871,7 +2871,7 @@ return; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -2881,13 +2881,13 @@ Lisp_Object signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, - const CIbyte *fmt, ...) + const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -2898,7 +2898,7 @@ maybe_signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb, - const CIbyte *fmt, ...) + const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; @@ -2908,7 +2908,7 @@ return Qnil; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -2987,155 +2987,155 @@ /* Called from within emacs_doprnt_1, so REASON is not formatted. */ DOESNT_RETURN -syntax_error (const CIbyte *reason, Lisp_Object frob) +syntax_error (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qsyntax_error, reason, frob); } DOESNT_RETURN -syntax_error_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2) +syntax_error_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) { signal_error_2 (Qsyntax_error, reason, frob1, frob2); } void -maybe_syntax_error (const CIbyte *reason, Lisp_Object frob, +maybe_syntax_error (const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { maybe_signal_error (Qsyntax_error, reason, frob, class_, errb); } DOESNT_RETURN -sferror (const CIbyte *reason, Lisp_Object frob) +sferror (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qstructure_formation_error, reason, frob); } DOESNT_RETURN -sferror_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2) +sferror_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) { signal_error_2 (Qstructure_formation_error, reason, frob1, frob2); } void -maybe_sferror (const CIbyte *reason, Lisp_Object frob, +maybe_sferror (const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { maybe_signal_error (Qstructure_formation_error, reason, frob, class_, errb); } DOESNT_RETURN -invalid_argument (const CIbyte *reason, Lisp_Object frob) +invalid_argument (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qinvalid_argument, reason, frob); } DOESNT_RETURN -invalid_argument_2 (const CIbyte *reason, Lisp_Object frob1, +invalid_argument_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) { signal_error_2 (Qinvalid_argument, reason, frob1, frob2); } void -maybe_invalid_argument (const CIbyte *reason, Lisp_Object frob, +maybe_invalid_argument (const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { maybe_signal_error (Qinvalid_argument, reason, frob, class_, errb); } DOESNT_RETURN -invalid_constant (const CIbyte *reason, Lisp_Object frob) +invalid_constant (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qinvalid_constant, reason, frob); } DOESNT_RETURN -invalid_constant_2 (const CIbyte *reason, Lisp_Object frob1, +invalid_constant_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) { signal_error_2 (Qinvalid_constant, reason, frob1, frob2); } void -maybe_invalid_constant (const CIbyte *reason, Lisp_Object frob, +maybe_invalid_constant (const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { maybe_signal_error (Qinvalid_constant, reason, frob, class_, errb); } DOESNT_RETURN -invalid_operation (const CIbyte *reason, Lisp_Object frob) +invalid_operation (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qinvalid_operation, reason, frob); } DOESNT_RETURN -invalid_operation_2 (const CIbyte *reason, Lisp_Object frob1, +invalid_operation_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) { signal_error_2 (Qinvalid_operation, reason, frob1, frob2); } void -maybe_invalid_operation (const CIbyte *reason, Lisp_Object frob, +maybe_invalid_operation (const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { maybe_signal_error (Qinvalid_operation, reason, frob, class_, errb); } DOESNT_RETURN -invalid_change (const CIbyte *reason, Lisp_Object frob) +invalid_change (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qinvalid_change, reason, frob); } DOESNT_RETURN -invalid_change_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2) +invalid_change_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) { signal_error_2 (Qinvalid_change, reason, frob1, frob2); } void -maybe_invalid_change (const CIbyte *reason, Lisp_Object frob, +maybe_invalid_change (const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { maybe_signal_error (Qinvalid_change, reason, frob, class_, errb); } DOESNT_RETURN -invalid_state (const CIbyte *reason, Lisp_Object frob) +invalid_state (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qinvalid_state, reason, frob); } DOESNT_RETURN -invalid_state_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2) +invalid_state_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2) { signal_error_2 (Qinvalid_state, reason, frob1, frob2); } void -maybe_invalid_state (const CIbyte *reason, Lisp_Object frob, +maybe_invalid_state (const Ascbyte *reason, Lisp_Object frob, Lisp_Object class_, Error_Behavior errb) { maybe_signal_error (Qinvalid_state, reason, frob, class_, errb); } DOESNT_RETURN -wtaerror (const CIbyte *reason, Lisp_Object frob) +wtaerror (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qwrong_type_argument, reason, frob); } DOESNT_RETURN -stack_overflow (const CIbyte *reason, Lisp_Object frob) +stack_overflow (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qstack_overflow, reason, frob); } DOESNT_RETURN -out_of_memory (const CIbyte *reason, Lisp_Object frob) +out_of_memory (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qout_of_memory, reason, frob); } @@ -4572,7 +4572,7 @@ if (0 == count) { - write_c_string (printcharfun, "#<zero-length multiple value>"); + write_msg_string (printcharfun, "#<zero-length multiple value>"); } for (index = 0; index < count;) @@ -4594,7 +4594,7 @@ if (count > 1 && index < count) { - write_c_string (printcharfun, " ;\n"); + write_ascstring (printcharfun, " ;\n"); } } } @@ -5713,7 +5713,7 @@ ("%s: Attempt to throw outside of function:" "To catch `%s' with value `%s'\n\nBacktrace follows:\n\n%s", Qnil, 4, - build_msg_string (warning_string ? warning_string : "error"), + build_msg_cistring (warning_string ? warning_string : "error"), p->thrown_tag, p->thrown_value, p->backtrace); warn_when_safe_lispobj (Qerror, current_warning_level (), errstr); } @@ -5728,7 +5728,7 @@ emacs_sprintf_string_lisp ("%s: (%s %s)\n\nBacktrace follows:\n\n%s", Qnil, 4, - build_msg_string (warning_string ? warning_string : "error"), + build_msg_cistring (warning_string ? warning_string : "error"), p->error_conditions, p->data, p->backtrace); warn_when_safe_lispobj (warning_class, current_warning_level (), @@ -7000,18 +7000,18 @@ || specpdl[speccount - 1].func == specbind_unwind_local || specpdl[speccount - 1].func == specbind_unwind_wasnt_local) { - write_c_string (stream, !printing_bindings ? " # bind (" : " "); + write_ascstring (stream, !printing_bindings ? " # bind (" : " "); Fprin1 (specpdl[speccount - 1].symbol, stream); printing_bindings = 1; } else { - if (printing_bindings) write_c_string (stream, ")\n"); - write_c_string (stream, " # (unwind-protect ...)\n"); + if (printing_bindings) write_ascstring (stream, ")\n"); + write_ascstring (stream, " # (unwind-protect ...)\n"); printing_bindings = 0; } } - if (printing_bindings) write_c_string (stream, ")\n"); + if (printing_bindings) write_ascstring (stream, ")\n"); } static Lisp_Object @@ -7020,7 +7020,7 @@ if (args) return *args; else - return list1 (build_string ("[internal]")); + return list1 (build_ascstring ("[internal]")); } DEFUN ("backtrace", Fbacktrace, 0, 2, "", /* @@ -7078,15 +7078,15 @@ speccount = catches->pdlcount; if (catchpdl == speccount) { - write_c_string (stream, " # (catch "); + write_ascstring (stream, " # (catch "); Fprin1 (catches->tag, stream); - write_c_string (stream, " ...)\n"); + write_ascstring (stream, " ...)\n"); } else { - write_c_string (stream, " # (condition-case ... . "); + write_ascstring (stream, " # (condition-case ... . "); Fprin1 (Fcdr (Fcar (catches->tag)), stream); - write_c_string (stream, ")\n"); + write_ascstring (stream, ")\n"); } catches = catches->next; } @@ -7099,19 +7099,19 @@ backtrace_specials (speccount, backlist->pdlcount, stream); speccount = backlist->pdlcount; } - write_c_string (stream, backlist->debug_on_exit ? "* " : " "); + write_ascstring (stream, backlist->debug_on_exit ? "* " : " "); if (backlist->nargs == UNEVALLED) { Fprin1 (Fcons (*backlist->function, backtrace_unevalled_args (backlist->args)), stream); - write_c_string (stream, "\n"); /* from FSFmacs 19.30 */ + write_ascstring (stream, "\n"); /* from FSFmacs 19.30 */ } else { Lisp_Object tem = *backlist->function; Fprin1 (tem, stream); /* This can QUIT */ - write_c_string (stream, "("); + write_ascstring (stream, "("); if (backlist->nargs == MANY) { int i; @@ -7123,7 +7123,7 @@ !NILP (tail); tail = Fcdr (tail), i++) { - if (i != 0) write_c_string (stream, " "); + if (i != 0) write_ascstring (stream, " "); Fprin1 (Fcar (tail), stream); } NUNGCPRO; @@ -7135,14 +7135,14 @@ { if (!i && EQ (tem, Qbyte_code)) { - write_c_string (stream, "\"...\""); + write_ascstring (stream, "\"...\""); continue; } - if (i != 0) write_c_string (stream, " "); + if (i != 0) write_ascstring (stream, " "); Fprin1 (backlist->args[i], stream); } } - write_c_string (stream, ")\n"); + write_ascstring (stream, ")\n"); } backlist = backlist->next; } @@ -7234,7 +7234,7 @@ automatically be called when it is safe to do so. */ void -warn_when_safe (Lisp_Object class_, Lisp_Object level, const CIbyte *fmt, ...) +warn_when_safe (Lisp_Object class_, Lisp_Object level, const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; @@ -7243,7 +7243,7 @@ return; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); warn_when_safe_lispobj (class_, level, obj);
--- a/src/event-Xt.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/event-Xt.c Tue Jan 26 23:22:30 2010 -0600 @@ -337,46 +337,46 @@ /* Boy, I really wish C had local functions... */ - /* The call to warn_when_safe must be on the same line as the string or - make-msgfile won't pick it up properly (the newline doesn't confuse - it, but the backslash does). */ - -#define modwarn(name,old,other) \ - warn_when_safe (Qkey_mapping, Qwarning, "XEmacs: %s (0x%x) generates %s, which is generated by %s.", \ - name, code, index_to_name (old), other), \ +#define modwarn(name,old,other) \ + warn_when_safe (Qkey_mapping, Qwarning, \ + "XEmacs: %s (0x%x) generates %s, which is generated by %s.", \ + name, code, index_to_name (old), other), \ warned_about_overlapping_modifiers = 1 -#define modbarf(name,other) \ - warn_when_safe (Qkey_mapping, Qwarning, "XEmacs: %s (0x%x) generates %s, which is nonsensical.", \ - name, code, other), \ +#define modbarf(name,other) \ + warn_when_safe (Qkey_mapping, Qwarning, \ + "XEmacs: %s (0x%x) generates %s, which is nonsensical.", \ + name, code, other), \ warned_about_predefined_modifiers = 1 -#define check_modifier(name,mask) \ - if ((1<<modifier_index) != mask) \ - warn_when_safe (Qkey_mapping, Qwarning, "XEmacs: %s (0x%x) generates %s, which is nonsensical.", \ - name, code, index_to_name (modifier_index)), \ +#define check_modifier(name,mask) \ + if ((1<<modifier_index) != mask) \ + warn_when_safe (Qkey_mapping, Qwarning, \ + "XEmacs: %s (0x%x) generates %s, which is nonsensical.", \ + name, code, index_to_name (modifier_index)), \ warned_about_predefined_modifiers = 1 -#define store_modifier(name,old) \ - if (old && old != modifier_index) \ - warn_when_safe (Qkey_mapping, Qwarning, "XEmacs: %s (0x%x) generates both %s and %s, which is nonsensical.",\ - name, code, index_to_name (old), \ - index_to_name (modifier_index)), \ - warned_about_duplicate_modifiers = 1; \ - if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \ - else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \ +#define store_modifier(name,old) \ + if (old && old != modifier_index) \ + warn_when_safe (Qkey_mapping, Qwarning, \ + "XEmacs: %s (0x%x) generates both %s and %s, which is nonsensical.", \ + name, code, index_to_name (old), \ + index_to_name (modifier_index)), \ + warned_about_duplicate_modifiers = 1; \ + if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift"); \ + else if (modifier_index == LockMapIndex) modbarf (name,"ModLock"); \ else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \ - else if (sym == XK_Mode_switch) \ - mode_bit = modifier_index; /* Mode_switch is special, see below... */ \ - else if (modifier_index == meta_bit && old != meta_bit) \ - modwarn (name, meta_bit, "Meta"); \ - else if (modifier_index == super_bit && old != super_bit) \ - modwarn (name, super_bit, "Super"); \ - else if (modifier_index == hyper_bit && old != hyper_bit) \ - modwarn (name, hyper_bit, "Hyper"); \ - else if (modifier_index == alt_bit && old != alt_bit) \ - modwarn (name, alt_bit, "Alt"); \ - else \ + else if (sym == XK_Mode_switch) \ + mode_bit = modifier_index; /* Mode_switch is special, see below... */ \ + else if (modifier_index == meta_bit && old != meta_bit) \ + modwarn (name, meta_bit, "Meta"); \ + else if (modifier_index == super_bit && old != super_bit) \ + modwarn (name, super_bit, "Super"); \ + else if (modifier_index == hyper_bit && old != hyper_bit) \ + modwarn (name, hyper_bit, "Hyper"); \ + else if (modifier_index == alt_bit && old != alt_bit) \ + modwarn (name, alt_bit, "Alt"); \ + else \ old = modifier_index; mkpm = xd->x_modifier_keymap->max_keypermod; @@ -1750,7 +1750,7 @@ { Lisp_Object console = CDFW_CONSOLE (EVENT_CHANNEL (event)); if (CONSOLE_X_P (XCONSOLE (console))) - write_c_string + write_ascstring (pstream, x_event_name ((EVENT_MAGIC_X_EVENT (event)).type)); } @@ -2426,7 +2426,7 @@ static void describe_event (XEvent *event, Lisp_Object pstream) { - char buf[100]; + Ascbyte buf[100]; struct device *d = get_device_from_display (event->xany.display); sprintf (buf, "%s%s", x_event_name (event->type),
--- a/src/event-gtk.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/event-gtk.c Tue Jan 26 23:22:30 2010 -0600 @@ -1019,8 +1019,8 @@ { /* Arbitrary string */ l_type = Qdragdrop_MIME; - l_dndlist = list1 (list3 (list1 (build_string ("text/plain")), - build_string ("8_bit"), + l_dndlist = list1 (list3 (list1 (build_ascstring ("text/plain")), + build_ascstring ("8_bit"), make_ext_string (data->data, strlen ((char *)data->data), Qctext))); @@ -1049,7 +1049,7 @@ */ l_type = Qdragdrop_MIME; l_dndlist = list1 (list3 (list1 (build_string (gdk_atom_name (data->type))), - build_string ("8bit"), + build_ascstring ("8bit"), make_ext_string ((Extbyte *) data->data, data->length, Qbinary))); } @@ -1876,10 +1876,6 @@ /* Boy, I really wish C had local functions... */ - /* The call to warn_when_safe must be on the same line as the string or - make-msgfile won't pick it up properly (the newline doesn't confuse - it, but the backslash does). */ - #define store_modifier(name,old) \ old = modifier_index;
--- a/src/event-msw.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/event-msw.c Tue Jan 26 23:22:30 2010 -0600 @@ -1752,9 +1752,9 @@ * get an error, or finish before the end of the string, * we know the original string had syntax errors. */ - args[0] = build_string ("(progn "); + args[0] = build_ascstring ("(progn "); args[1] = str; - args[2] = build_string (")"); + args[2] = build_ascstring (")"); str = Fconcat (3, args); obj = Fread_from_string (str, Qnil, Qnil); @@ -1820,10 +1820,10 @@ else { static int num = 0; - char buf[20]; + Ascbyte buf[20]; sprintf (buf, "Tok%d", num); ++num; - name = build_string (buf); + name = build_ascstring (buf); } token = Qnil; @@ -1989,12 +1989,12 @@ { if (NILP (dde_eval_error)) { - args[0] = build_string ("OK: %s"); + args[0] = build_ascstring ("OK: %s"); args[1] = dde_eval_result; } else { - args[0] = build_string ("ERR: %s"); + args[0] = build_ascstring ("ERR: %s"); args[1] = dde_eval_error; } } @@ -2013,7 +2013,7 @@ if (!DdeCmpStringHandles (hszItem, hsz)) args[1] = Fsymbol_value (elt); } - args[0] = build_string ("%s"); + args[0] = build_ascstring ("%s"); } res = Fformat (2, args); @@ -4274,7 +4274,7 @@ emacs_mswindows_format_magic_event (Lisp_Event *emacs_event, Lisp_Object pstream) { -#define FROB(msg) case msg: write_c_string (pstream, "type=" #msg); break +#define FROB(msg) case msg: write_ascstring (pstream, "type=" #msg); break switch (EVENT_MAGIC_MSWINDOWS_EVENT (emacs_event)) { @@ -4291,7 +4291,7 @@ if (!NILP (EVENT_CHANNEL (emacs_event))) { - write_c_string (pstream, " "); + write_ascstring (pstream, " "); print_internal (EVENT_CHANNEL (emacs_event), pstream, 1); } }
--- a/src/event-stream.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/event-stream.c Tue Jan 26 23:22:30 2010 -0600 @@ -255,13 +255,14 @@ Fixnum debug_emacs_events; static void -external_debugging_print_event (const char *event_description, Lisp_Object event) +external_debugging_print_event (const Ascbyte *event_description, + Lisp_Object event) { - write_c_string (Qexternal_debugging_output, "("); - write_c_string (Qexternal_debugging_output, event_description); - write_c_string (Qexternal_debugging_output, ") "); + write_ascstring (Qexternal_debugging_output, "("); + write_ascstring (Qexternal_debugging_output, event_description); + write_ascstring (Qexternal_debugging_output, ") "); print_internal (event, Qexternal_debugging_output, 1); - write_c_string (Qexternal_debugging_output, "\n"); + write_ascstring (Qexternal_debugging_output, "\n"); } #define DEBUG_PRINT_EMACS_EVENT(event_description, event) do { \ if (debug_emacs_events) \ @@ -846,7 +847,7 @@ help = IGNORE_MULTIPLE_VALUES (Feval (Vhelp_form)); if (STRINGP (help)) - internal_with_output_to_temp_buffer (build_string ("*Help*"), + internal_with_output_to_temp_buffer (build_ascstring ("*Help*"), print_help, help, Qnil); Fnext_command_event (event, Qnil); /* Remove the help from the frame */ @@ -4979,9 +4980,9 @@ last_point_position_buffer = Qnil; staticpro (&last_point_position_buffer); - QSnext_event_internal = build_string ("next_event_internal()"); + QSnext_event_internal = build_ascstring ("next_event_internal()"); staticpro (&QSnext_event_internal); - QSexecute_internal_event = build_string ("execute_internal_event()"); + QSexecute_internal_event = build_ascstring ("execute_internal_event()"); staticpro (&QSexecute_internal_event); DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes /*
--- a/src/events.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/events.c Tue Jan 26 23:22:30 2010 -0600 @@ -320,10 +320,10 @@ } static void -print_event_1 (const char *str, Lisp_Object obj, Lisp_Object printcharfun) +print_event_1 (const Ascbyte *str, Lisp_Object obj, Lisp_Object printcharfun) { DECLARE_EISTRING_MALLOC (ei); - write_c_string (printcharfun, str); + write_ascstring (printcharfun, str); format_event_object (ei, obj, 0); write_eistring (printcharfun, ei); eifree (ei); @@ -371,7 +371,7 @@ XEVENT_TIMEOUT_OBJECT (obj)); break; case empty_event: - write_c_string (printcharfun, "#<empty-event"); + write_ascstring (printcharfun, "#<empty-event"); break; case misc_user_event: write_fmt_string_lisp (printcharfun, "#<misc-user-event (%S", 1, @@ -386,13 +386,13 @@ XEVENT_EVAL_OBJECT (obj)); break; case dead_event: - write_c_string (printcharfun, "#<DEALLOCATED-EVENT"); + write_ascstring (printcharfun, "#<DEALLOCATED-EVENT"); break; default: - write_c_string (printcharfun, "#<UNKNOWN-EVENT-TYPE"); + write_ascstring (printcharfun, "#<UNKNOWN-EVENT-TYPE"); break; } - write_c_string (printcharfun, ">"); + write_ascstring (printcharfun, ">"); } static int
--- a/src/extents.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/extents.c Tue Jan 26 23:22:30 2010 -0600 @@ -3272,7 +3272,7 @@ EXTENT ext = XEXTENT (obj); EXTENT anc = extent_ancestor (ext); Lisp_Object tail; - char buf[64], *bp = buf; + Ascbyte buf[64], *bp = buf; /* Retrieve the ancestor and use it, for faster retrieval of properties */ @@ -3300,7 +3300,7 @@ extent_duplicable_p (anc) || !NILP (extent_invisible (anc))) *bp++ = ' '; *bp = '\0'; - write_c_string (printcharfun, buf); + write_ascstring (printcharfun, buf); tail = extent_plist_slot (anc); @@ -3362,12 +3362,12 @@ } if (!EXTENT_LIVE_P (XEXTENT (obj))) - write_c_string (printcharfun, "#<destroyed extent"); + write_ascstring (printcharfun, "#<destroyed extent"); else { - write_c_string (printcharfun, "#<extent "); + write_ascstring (printcharfun, "#<extent "); print_extent_1 (obj, printcharfun, escapeflag); - write_c_string (printcharfun, extent_detached_p (XEXTENT (obj)) + write_ascstring (printcharfun, extent_detached_p (XEXTENT (obj)) ? " from " : " in "); write_fmt_string (printcharfun, "%s%s%s", title, name, posttitle); } @@ -3376,9 +3376,9 @@ { if (print_readably) printing_unreadable_object ("#<extent>"); - write_c_string (printcharfun, "#<extent"); - } - write_c_string (printcharfun, ">"); + write_ascstring (printcharfun, "#<extent"); + } + write_ascstring (printcharfun, ">"); } static int @@ -7642,6 +7642,6 @@ Vextent_face_reverse_memoize_hash_table = make_lisp_hash_table (100, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQ); - QSin_map_extents_internal = build_msg_string ("(in map-extents-internal)"); + QSin_map_extents_internal = build_defer_string ("(in map-extents-internal)"); staticpro (&QSin_map_extents_internal); }
--- a/src/faces.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/faces.c Tue Jan 26 23:22:30 2010 -0600 @@ -137,7 +137,7 @@ write_fmt_string_lisp (printcharfun, "#<face %S", 1, face->name); if (!NILP (face->doc_string)) write_fmt_string_lisp (printcharfun, " %S", 1, face->doc_string); - write_c_string (printcharfun, ">"); + write_ascstring (printcharfun, ">"); } } @@ -2229,7 +2229,7 @@ Vdefault_face = Qnil; /* so that Fmake_face() doesn't set up a bogus default value */ - Vdefault_face = Fmake_face (Qdefault, build_msg_string ("default face"), + Vdefault_face = Fmake_face (Qdefault, build_defer_string ("default face"), Qnil); /* Provide some last-resort fallbacks to avoid utter fuckage if @@ -2239,22 +2239,22 @@ Lisp_Object fg_fb = Qnil, bg_fb = Qnil; #ifdef HAVE_GTK - fg_fb = acons (list1 (Qgtk), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qgtk), build_string ("white"), bg_fb); + fg_fb = acons (list1 (Qgtk), build_ascstring ("black"), fg_fb); + bg_fb = acons (list1 (Qgtk), build_ascstring ("white"), bg_fb); #endif #ifdef HAVE_X_WINDOWS - fg_fb = acons (list1 (Qx), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qx), build_string ("gray80"), bg_fb); + fg_fb = acons (list1 (Qx), build_ascstring ("black"), fg_fb); + bg_fb = acons (list1 (Qx), build_ascstring ("gray80"), bg_fb); #endif #ifdef HAVE_TTY fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb); bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb); #endif #ifdef HAVE_MS_WINDOWS - fg_fb = acons (list1 (Qmsprinter), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qmsprinter), build_string ("white"), bg_fb); - fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qmswindows), build_string ("white"), bg_fb); + fg_fb = acons (list1 (Qmsprinter), build_ascstring ("black"), fg_fb); + bg_fb = acons (list1 (Qmsprinter), build_ascstring ("white"), bg_fb); + fg_fb = acons (list1 (Qmswindows), build_ascstring ("black"), fg_fb); + bg_fb = acons (list1 (Qmswindows), build_ascstring ("white"), bg_fb); #endif set_specifier_fallback (Fget (Vdefault_face, Qforeground, Qnil), fg_fb); set_specifier_fallback (Fget (Vdefault_face, Qbackground, Qnil), bg_fb); @@ -2345,7 +2345,7 @@ (list1 (device_symbol), /* grrr. This really does need to be "*", not an XLFD. An unspecified XLFD won't pick up stuff like 10x20. */ - build_string ("*")), + build_ascstring ("*")), inst_list); #ifdef MULE @@ -2359,7 +2359,7 @@ Fcons (Fcons (list4(device_symbol, Qtwo_dimensional, Qfinal, Qx_coverage_instantiator), - build_string + build_ascstring ("-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1")), inst_list); @@ -2371,7 +2371,7 @@ Fcons (Fcons (list4(device_symbol, Qone_dimensional, Qfinal, Qx_coverage_instantiator), - build_string + build_ascstring ("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")), inst_list); @@ -2391,7 +2391,7 @@ Fcons (Fcons (list4(device_symbol, Qencode_as_utf_8, Qinitial, Qx_coverage_instantiator), - build_string + build_ascstring ("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")), inst_list); @@ -2403,7 +2403,7 @@ Fcons (Fcons (list1 (device_symbol), - build_string ("-*-*-medium-r-*-*-*-120-*-*-c-*-*-*")), + build_ascstring ("-*-*-medium-r-*-*-*-120-*-*-c-*-*-*")), inst_list); /* With a Cygwin XFree86 install, this returns the best (clearest, @@ -2416,7 +2416,7 @@ Fcons (Fcons (list1 (device_symbol), - build_string ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")), + build_ascstring ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")), inst_list); #endif /* !USE_XFT */ @@ -2424,7 +2424,7 @@ #endif /* HAVE_X_WINDOWS || HAVE_GTK */ #ifdef HAVE_TTY - inst_list = Fcons (Fcons (list1 (Qtty), build_string ("normal")), + inst_list = Fcons (Fcons (list1 (Qtty), build_ascstring ("normal")), inst_list); #endif /* HAVE_TTY */ @@ -2443,18 +2443,18 @@ { /* display device */ inst_list = Fcons (Fcons (list1 (Qmswindows), - build_string (*mswfontptr)), + build_ascstring (*mswfontptr)), inst_list); /* printer device */ inst_list = Fcons (Fcons (list1 (Qmsprinter), - build_string (*mswfontptr)), + build_ascstring (*mswfontptr)), inst_list); } /* Use Lucida Console rather than Courier New if it exists -- the line spacing is much less, so many more lines fit with the same size font. (And it's specifically designed for screens.) */ inst_list = Fcons (Fcons (list1 (Qmswindows), - build_string ("Lucida Console:Regular:10::")), + build_ascstring ("Lucida Console:Regular:10::")), inst_list); } #endif /* HAVE_MS_WINDOWS */ @@ -2478,7 +2478,7 @@ /* gui-element is the parent face of all gui elements such as modeline, vertical divider and toolbar. */ Vgui_element_face = Fmake_face (Qgui_element, - build_msg_string ("gui element face"), + build_defer_string ("gui element face"), Qnil); /* Provide some last-resort fallbacks for gui-element face which @@ -2492,22 +2492,22 @@ /* We need to put something in there, or error checking gets #%!@#ed up before the styles are set, which override the fallbacks. */ - fg_fb = acons (list1 (Qgtk), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qgtk), build_string ("Gray80"), bg_fb); + fg_fb = acons (list1 (Qgtk), build_ascstring ("black"), fg_fb); + bg_fb = acons (list1 (Qgtk), build_ascstring ("Gray80"), bg_fb); #endif #ifdef HAVE_X_WINDOWS - fg_fb = acons (list1 (Qx), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qx), build_string ("Gray80"), bg_fb); + fg_fb = acons (list1 (Qx), build_ascstring ("black"), fg_fb); + bg_fb = acons (list1 (Qx), build_ascstring ("Gray80"), bg_fb); #endif #ifdef HAVE_TTY fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb); bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb); #endif #ifdef HAVE_MS_WINDOWS - fg_fb = acons (list1 (Qmsprinter), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qmsprinter), build_string ("white"), bg_fb); - fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb); - bg_fb = acons (list1 (Qmswindows), build_string ("Gray75"), bg_fb); + fg_fb = acons (list1 (Qmsprinter), build_ascstring ("black"), fg_fb); + bg_fb = acons (list1 (Qmsprinter), build_ascstring ("white"), bg_fb); + fg_fb = acons (list1 (Qmswindows), build_ascstring ("black"), fg_fb); + bg_fb = acons (list1 (Qmswindows), build_ascstring ("Gray75"), bg_fb); #endif set_specifier_fallback (Fget (Vgui_element_face, Qforeground, Qnil), fg_fb); set_specifier_fallback (Fget (Vgui_element_face, Qbackground, Qnil), bg_fb); @@ -2518,7 +2518,7 @@ way since we need to get them anyway. */ /* modeline is gui element. */ - Vmodeline_face = Fmake_face (Qmodeline, build_msg_string ("modeline face"), + Vmodeline_face = Fmake_face (Qmodeline, build_defer_string ("modeline face"), Qnil); set_specifier_fallback (Fget (Vmodeline_face, Qforeground, Qunbound), @@ -2531,7 +2531,7 @@ /* toolbar is another gui element */ Vtoolbar_face = Fmake_face (Qtoolbar, - build_msg_string ("toolbar face"), + build_defer_string ("toolbar face"), Qnil); set_specifier_fallback (Fget (Vtoolbar_face, Qforeground, Qunbound), Fget (Vgui_element_face, Qforeground, Qunbound)); @@ -2543,7 +2543,7 @@ /* vertical divider is another gui element */ Vvertical_divider_face = Fmake_face (Qvertical_divider, - build_msg_string ("vertical divider face"), + build_defer_string ("vertical divider face"), Qnil); set_specifier_fallback (Fget (Vvertical_divider_face, Qforeground, Qunbound), @@ -2557,7 +2557,7 @@ /* widget is another gui element */ Vwidget_face = Fmake_face (Qwidget, - build_msg_string ("widget face"), + build_defer_string ("widget face"), Qnil); /* #### weird ... the gui-element face doesn't have its own font yet */ set_specifier_fallback (Fget (Vwidget_face, Qfont, Qunbound), @@ -2569,17 +2569,17 @@ /* We don't want widgets to have a default background pixmap. */ Vleft_margin_face = Fmake_face (Qleft_margin, - build_msg_string ("left margin face"), + build_defer_string ("left margin face"), Qnil); Vright_margin_face = Fmake_face (Qright_margin, - build_msg_string ("right margin face"), + build_defer_string ("right margin face"), Qnil); Vtext_cursor_face = Fmake_face (Qtext_cursor, - build_msg_string ("face for text cursor"), + build_defer_string ("face for text cursor"), Qnil); Vpointer_face = Fmake_face (Qpointer, - build_msg_string + build_defer_string ("face for foreground/background colors of mouse pointer"), Qnil); }
--- a/src/file-coding.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/file-coding.c Tue Jan 26 23:22:30 2010 -0600 @@ -301,7 +301,7 @@ write_fmt_string_lisp (printcharfun, "#<coding-system %s ", 1, c->name); print_coding_system_properties (obj, printcharfun); - write_c_string (printcharfun, ">"); + write_ascstring (printcharfun, ">"); } /* Print an abbreviated version of a coding system (but still containing @@ -313,7 +313,7 @@ { write_fmt_string_lisp (printcharfun, "%s[", 1, XCODING_SYSTEM_NAME (cs)); print_coding_system_properties (cs, printcharfun); - write_c_string (printcharfun, "]"); + write_ascstring (printcharfun, "]"); } #ifndef NEW_GC @@ -521,18 +521,12 @@ if (flags & QUERY_METHOD_ERRORP) { - DECLARE_EISTRING (error_details); - - eicpy_ascii (error_details, "Cannot encode "); - eicat_lstr (error_details, - make_string_from_buffer (buf, fail_range_start, - pos - - fail_range_start)); - eicat_ascii (error_details, " using coding system"); - - signal_error (Qtext_conversion_error, - (const CIbyte *)(eidata (error_details)), - XCODING_SYSTEM_NAME (codesys)); + signal_error_2 + (Qtext_conversion_error, + "Cannot encode using coding system", + make_string_from_buffer (buf, fail_range_start, + pos - fail_range_start), + XCODING_SYSTEM_NAME (codesys)); } if (NILP (result)) @@ -697,7 +691,7 @@ /* Keep around the form so it doesn't disappear from under #'eval's feet. */ GCPRO1 (lookup); - call1_trapping_problems ((const CIbyte *)eidata (warning_info), + call1_trapping_problems ((const CIbyte *) eidata (warning_info), Qeval, lookup, 0); UNGCPRO; @@ -1248,7 +1242,7 @@ cs->internal_p = !!prefix; if (NILP (description)) - description = build_string (""); + description = build_ascstring (""); else CHECK_STRING (description); CODING_SYSTEM_DESCRIPTION (cs) = description; @@ -2612,10 +2606,10 @@ { int i; - write_c_string (printcharfun, "("); + write_ascstring (printcharfun, "("); for (i = 0; i < XCODING_SYSTEM_CHAIN_COUNT (cs); i++) { - write_c_string (printcharfun, i == 0 ? "" : "->"); + write_ascstring (printcharfun, i == 0 ? "" : "->"); print_coding_system_in_print_method (XCODING_SYSTEM_CHAIN_CHAIN (cs)[i], printcharfun, escapeflag); } @@ -2624,13 +2618,13 @@ if (!NILP (cac)) { if (i > 0) - write_c_string (printcharfun, " "); - write_c_string (printcharfun, "canonicalize-after-coding="); + write_ascstring (printcharfun, " "); + write_ascstring (printcharfun, "canonicalize-after-coding="); print_coding_system_in_print_method (cac, printcharfun, escapeflag); } } - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); } static void @@ -3270,27 +3264,27 @@ XCODING_SYSTEM_TYPE_DATA (cs, undecided); int need_space = 0; - write_c_string (printcharfun, "("); + write_ascstring (printcharfun, "("); if (data->do_eol) { - write_c_string (printcharfun, "do-eol"); + write_ascstring (printcharfun, "do-eol"); need_space = 1; } if (data->do_coding) { if (need_space) - write_c_string (printcharfun, " "); - write_c_string (printcharfun, "do-coding"); + write_ascstring (printcharfun, " "); + write_ascstring (printcharfun, "do-coding"); need_space = 1; } if (!NILP (data->cs)) { if (need_space) - write_c_string (printcharfun, " "); - write_c_string (printcharfun, "coding-system="); + write_ascstring (printcharfun, " "); + write_ascstring (printcharfun, "coding-system="); print_coding_system_in_print_method (data->cs, printcharfun, escapeflag); } - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); } static void @@ -4312,12 +4306,12 @@ { struct gzip_coding_system *data = XCODING_SYSTEM_TYPE_DATA (cs, gzip); - write_c_string (printcharfun, "("); + write_ascstring (printcharfun, "("); if (data->level == -1) - write_c_string (printcharfun, "default"); + write_ascstring (printcharfun, "default"); else print_internal (make_int (data->level), printcharfun, 0); - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); } static int @@ -4750,7 +4744,7 @@ /* We always have file-coding support */ Fprovide (intern ("file-coding")); - QScoding_system_cookie = build_string (";;;###coding system: "); + QScoding_system_cookie = build_ascstring (";;;###coding system: "); staticpro (&QScoding_system_cookie); #ifdef HAVE_DEFAULT_EOL_DETECTION @@ -4838,12 +4832,12 @@ { Fmake_coding_system_internal (Qconvert_eol_cr, Qconvert_eol, - build_msg_string ("Convert CR to LF"), + build_defer_string ("Convert CR to LF"), nconc2 (list6 (Qdocumentation, - build_msg_string ( + build_defer_string ( "Converts CR (used to mark the end of a line on Macintosh systems) to LF\n" "(used internally and under Unix to mark the end of a line)."), - Qmnemonic, build_string ("CR->LF"), + Qmnemonic, build_ascstring ("CR->LF"), Qsubtype, Qcr), /* VERY IMPORTANT! Tell make-coding-system not to generate subsidiaries -- it needs the coding systems we're creating @@ -4853,11 +4847,11 @@ Fmake_coding_system_internal (Qconvert_eol_lf, Qconvert_eol, - build_msg_string ("Convert LF to LF (do nothing)"), + build_defer_string ("Convert LF to LF (do nothing)"), nconc2 (list6 (Qdocumentation, - build_msg_string ( + build_defer_string ( "Do nothing."), - Qmnemonic, build_string ("LF->LF"), + Qmnemonic, build_ascstring ("LF->LF"), Qsubtype, Qlf), /* VERY IMPORTANT! Tell make-coding-system not to generate subsidiaries -- it needs the coding systems we're creating @@ -4867,12 +4861,12 @@ Fmake_coding_system_internal (Qconvert_eol_crlf, Qconvert_eol, - build_msg_string ("Convert CRLF to LF"), + build_defer_string ("Convert CRLF to LF"), nconc2 (list6 (Qdocumentation, - build_msg_string ( + build_defer_string ( "Converts CR+LF (used to mark the end of a line on Macintosh systems) to LF\n" "(used internally and under Unix to mark the end of a line)."), - Qmnemonic, build_string ("CRLF->LF"), + Qmnemonic, build_ascstring ("CRLF->LF"), Qsubtype, Qcrlf), /* VERY IMPORTANT! Tell make-coding-system not to generate @@ -4883,11 +4877,11 @@ Fmake_coding_system_internal (Qconvert_eol_autodetect, Qconvert_eol, - build_msg_string ("Autodetect EOL type"), + build_defer_string ("Autodetect EOL type"), nconc2 (list6 (Qdocumentation, - build_msg_string ( + build_defer_string ( "Autodetect the end-of-line type."), - Qmnemonic, build_string ("Auto-EOL"), + Qmnemonic, build_ascstring ("Auto-EOL"), Qsubtype, Qnil), /* VERY IMPORTANT! Tell make-coding-system not to generate subsidiaries -- it needs the coding systems we're creating @@ -4897,11 +4891,11 @@ Fmake_coding_system_internal (Qundecided, Qundecided, - build_msg_string ("Undecided (auto-detect)"), + build_defer_string ("Undecided (auto-detect)"), nconc2 (list4 (Qdocumentation, - build_msg_string + build_defer_string ("Automatically detects the correct encoding."), - Qmnemonic, build_string ("Auto")), + Qmnemonic, build_ascstring ("Auto")), list6 (Qdo_eol, Qt, Qdo_coding, Qt, /* We do EOL detection ourselves so we don't need to be wrapped in an EOL detector. (It doesn't actually hurt, @@ -4910,43 +4904,43 @@ Fmake_coding_system_internal (intern ("undecided-dos"), Qundecided, - build_msg_string ("Undecided (auto-detect) (CRLF)"), + build_defer_string ("Undecided (auto-detect) (CRLF)"), nconc2 (list4 (Qdocumentation, - build_msg_string + build_defer_string ("Automatically detects the correct encoding; EOL type of CRLF forced."), - Qmnemonic, build_string ("Auto")), + Qmnemonic, build_ascstring ("Auto")), list4 (Qdo_coding, Qt, Qeol_type, Qcrlf))); Fmake_coding_system_internal (intern ("undecided-unix"), Qundecided, - build_msg_string ("Undecided (auto-detect) (LF)"), + build_defer_string ("Undecided (auto-detect) (LF)"), nconc2 (list4 (Qdocumentation, - build_msg_string + build_defer_string ("Automatically detects the correct encoding; EOL type of LF forced."), - Qmnemonic, build_string ("Auto")), + Qmnemonic, build_ascstring ("Auto")), list4 (Qdo_coding, Qt, Qeol_type, Qlf))); Fmake_coding_system_internal (intern ("undecided-mac"), Qundecided, - build_msg_string ("Undecided (auto-detect) (CR)"), + build_defer_string ("Undecided (auto-detect) (CR)"), nconc2 (list4 (Qdocumentation, - build_msg_string + build_defer_string ("Automatically detects the correct encoding; EOL type of CR forced."), - Qmnemonic, build_string ("Auto")), + Qmnemonic, build_ascstring ("Auto")), list4 (Qdo_coding, Qt, Qeol_type, Qcr))); /* Need to create this here or we're really screwed. */ Fmake_coding_system_internal (Qraw_text, Qno_conversion, - build_msg_string ("Raw Text"), + build_defer_string ("Raw Text"), nconc2 (list4 (Qdocumentation, - build_msg_string ("Raw text converts only line-break " + build_defer_string ("Raw text converts only line-break " "codes, and acts otherwise like " "`binary'."), - Qmnemonic, build_string ("Raw")), + Qmnemonic, build_ascstring ("Raw")), #ifdef MULE list2 (Qsafe_charsets, list3 (Vcharset_ascii, Vcharset_control_1, Vcharset_latin_iso8859_1)))); @@ -4957,9 +4951,9 @@ Fmake_coding_system_internal (Qbinary, Qno_conversion, - build_msg_string ("Binary"), + build_defer_string ("Binary"), nconc2 (list6 (Qdocumentation, - build_msg_string ( + build_defer_string ( "This coding system is as close as it comes to doing no conversion.\n" "On input, each byte is converted directly into the character\n" "with the corresponding code -- i.e. from the `ascii', `control-1',\n" @@ -4967,7 +4961,7 @@ "converted back to the corresponding bytes, and other characters\n" "are converted to the default character, i.e. `~'."), Qeol_type, Qlf, - Qmnemonic, build_string ("Binary")), + Qmnemonic, build_ascstring ("Binary")), #ifdef MULE list2 (Qsafe_charsets, list3 (Vcharset_ascii, Vcharset_control_1, Vcharset_latin_iso8859_1))));
--- a/src/fileio.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/fileio.c Tue Jan 26 23:22:30 2010 -0600 @@ -143,13 +143,13 @@ DOESNT_RETURN report_file_type_error (Lisp_Object errtype, Lisp_Object oserrmess, - const CIbyte *string, Lisp_Object data) + const Ascbyte *reason, Lisp_Object data) { struct gcpro gcpro1; Lisp_Object errdata = build_error_data (NULL, data); GCPRO1 (errdata); - errdata = Fcons (build_msg_string (string), + errdata = Fcons (build_msg_string (reason), Fcons (oserrmess, errdata)); signal_error_1 (errtype, errdata); /* UNGCPRO; not reached */ @@ -157,17 +157,17 @@ DOESNT_RETURN report_error_with_errno (Lisp_Object errtype, - const CIbyte *string, Lisp_Object data) + const Ascbyte *reason, Lisp_Object data) { - report_file_type_error (errtype, lisp_strerror (errno), string, data); + report_file_type_error (errtype, lisp_strerror (errno), reason, data); } /* signal a file error when errno contains a meaningful value. */ DOESNT_RETURN -report_file_error (const CIbyte *string, Lisp_Object data) +report_file_error (const Ascbyte *reason, Lisp_Object data) { - report_error_with_errno (Qfile_error, string, data); + report_error_with_errno (Qfile_error, reason, data); } @@ -787,7 +787,7 @@ if (NILP (default_directory)) default_directory = current_buffer->directory; if (! STRINGP (default_directory)) - default_directory = build_string (DEFAULT_DIRECTORY_FALLBACK); + default_directory = build_ascstring (DEFAULT_DIRECTORY_FALLBACK); if (!NILP (default_directory)) { @@ -1761,7 +1761,7 @@ If the file does not exist, STATPTR->st_mode is set to 0. */ static void -barf_or_query_if_file_exists (Lisp_Object absname, const CIbyte *querystring, +barf_or_query_if_file_exists (Lisp_Object absname, const Ascbyte *querystring, int interactive, struct stat *statptr) { /* This function can call Lisp. GC checked 2000-07-28 ben */ @@ -1780,8 +1780,8 @@ prompt = emacs_sprintf_string - (CGETTEXT ("File %s already exists; %s anyway? "), - XSTRING_DATA (absname), CGETTEXT (querystring)); + (GETTEXT ("File %s already exists; %s anyway? "), + XSTRING_DATA (absname), GETTEXT (querystring)); GCPRO1 (prompt); tem = call1 (Qyes_or_no_p, prompt); @@ -2103,7 +2103,7 @@ NGCPRO1 (*args); ngcpro1.nvars = 3; if (string_byte (newname, XSTRING_LENGTH (newname) - 1) != '/') - args[i++] = build_string ("/"); + args[i++] = build_ascstring ("/"); args[i++] = Ffile_name_nondirectory (filename); newname = Fconcat (i, args); NUNGCPRO; @@ -4477,7 +4477,7 @@ vars_of_fileio (void) { QSin_expand_file_name = - build_msg_string ("(in expand-file-name)"); + build_defer_string ("(in expand-file-name)"); staticpro (&QSin_expand_file_name); DEFVAR_LISP ("auto-save-file-format", &Vauto_save_file_format /* @@ -4563,7 +4563,7 @@ Emacs's pid and the system name will be appended to this prefix to create a unique file name. */ ); - Vauto_save_list_file_prefix = build_string ("~/.saves-"); + Vauto_save_list_file_prefix = build_ascstring ("~/.saves-"); DEFVAR_BOOL ("inhibit-auto-save-session", &inhibit_auto_save_session /* When non-nil, inhibit auto save list file creation.
--- a/src/floatfns.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/floatfns.c Tue Jan 26 23:22:30 2010 -0600 @@ -2453,7 +2453,7 @@ /* if (!strcmp (x->name, "pow")) x->name = "expt"; */ - args = Fcons (build_string (x->name), + args = Fcons (build_ext_string (x->name, Qerror_message_encoding), Fcons (make_float (x->arg1), ((in_float == 2) ? Fcons (make_float (x->arg2), Qnil)
--- a/src/fns.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/fns.c Tue Jan 26 23:22:30 2010 -0600 @@ -81,17 +81,17 @@ if (INTP (Vprint_length)) last = min (len, XINT (Vprint_length)); - write_c_string (printcharfun, "#*"); + write_ascstring (printcharfun, "#*"); for (i = 0; i < last; i++) { if (bit_vector_bit (v, i)) - write_c_string (printcharfun, "1"); + write_ascstring (printcharfun, "1"); else - write_c_string (printcharfun, "0"); + write_ascstring (printcharfun, "0"); } if (last != len) - write_c_string (printcharfun, "..."); + write_ascstring (printcharfun, "..."); } static int @@ -3288,7 +3288,7 @@ EMACS_INT i; EMACS_INT nargs = len + len - 1; - if (len == 0) return build_string (""); + if (len == 0) return build_ascstring (""); args = alloca_array (Lisp_Object, nargs); @@ -3399,14 +3399,14 @@ add_suffix_to_symbol (Lisp_Object symbol, const Ascbyte *ascii_string) { return Fintern (concat2 (Fsymbol_name (symbol), - build_string (ascii_string)), + build_ascstring (ascii_string)), Qnil); } Lisp_Object add_prefix_to_symbol (const Ascbyte *ascii_string, Lisp_Object symbol) { - return Fintern (concat2 (build_string (ascii_string), + return Fintern (concat2 (build_ascstring (ascii_string), Fsymbol_name (symbol)), Qnil); }
--- a/src/frame-gtk.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/frame-gtk.c Tue Jan 26 23:22:30 2010 -0600 @@ -1157,12 +1157,12 @@ */ (frame)) { - char str[255]; + Ascbyte str[255]; struct frame *f = decode_gtk_frame (frame); /* Arrrrggghhh... this defeats the whole purpose of using Gdk... do we really need this? */ sprintf (str, "%lu", GDK_WINDOW_XWINDOW( GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f)))); - return build_string (str); + return build_ascstring (str); } #endif
--- a/src/frame-x.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/frame-x.c Tue Jan 26 23:22:30 2010 -0600 @@ -466,7 +466,7 @@ init_x_prop_symbols (void) { #define def(sym, rsrc) \ - Fput (sym, Qx_resource_name, build_string (rsrc)) + Fput (sym, Qx_resource_name, build_ascstring (rsrc)) #define defi(sym,rsrc) \ def (sym, rsrc); Fput (sym, Qintegerp, Qt) @@ -1300,8 +1300,8 @@ : build_ext_string (filePath, Q???); */ /* what, if the data is no text, and how can I tell it? */ l_data = - Fcons (list3 (list1 (build_string ("text/plain")), - build_string ("8bit"), + Fcons (list3 (list1 (build_ascstring ("text/plain")), + build_ascstring ("8bit"), make_ext_string (transferInfo->dropData->data.buffers[ii].bp, transferInfo->dropData->data.buffers[ii].size,
--- a/src/frame.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/frame.c Tue Jan 26 23:22:30 2010 -0600 @@ -529,17 +529,17 @@ { /* We leave Vdefault_frame_name alone here so that it'll remain Qnil in the dumped executable, and we can choose it at runtime. */ - name = build_string("XEmacs"); + name = build_ascstring ("XEmacs"); } else if (NILP (Vdefault_frame_name)) { if (egetenv ("USE_EMACS_AS_DEFAULT_APPLICATION_CLASS")) { - Vdefault_frame_name = build_string ("emacs"); + Vdefault_frame_name = build_ascstring ("emacs"); } else { - Vdefault_frame_name = build_string ("XEmacs"); + Vdefault_frame_name = build_ascstring ("XEmacs"); } } @@ -3862,16 +3862,16 @@ /* #### I would change this unilaterally but for the wrath of the Kyles of the world. */ #ifdef WIN32_NATIVE - Vframe_title_format = build_string ("%b - XEmacs"); + Vframe_title_format = build_ascstring ("%b - XEmacs"); #else - Vframe_title_format = build_string ("%S: %b"); + Vframe_title_format = build_ascstring ("%S: %b"); #endif DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /* Controls the title of the icon corresponding to the selected frame. See also the variable `frame-title-format'. */ ); - Vframe_icon_title_format = build_string ("%b"); + Vframe_icon_title_format = build_ascstring ("%b"); DEFVAR_LISP ("default-frame-name", &Vdefault_frame_name /* The default name to assign to newly-created frames.
--- a/src/gc.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/gc.c Tue Jan 26 23:22:30 2010 -0600 @@ -1497,7 +1497,7 @@ Lisp_Object args[2], whole_msg; args[0] = (STRINGP (Vgc_message) ? Vgc_message : build_msg_string (gc_default_message)); - args[1] = build_string ("..."); + args[1] = build_ascstring ("..."); whole_msg = Fconcat (2, args); echo_area_message (f, (Ibyte *) 0, whole_msg, 0, -1, Qgarbage_collecting); @@ -2102,7 +2102,7 @@ { staticpro_nodump (&pre_gc_cursor); - QSin_garbage_collection = build_msg_string ("(in garbage collection)"); + QSin_garbage_collection = build_defer_string ("(in garbage collection)"); staticpro (&QSin_garbage_collection); DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold /* @@ -2197,7 +2197,7 @@ image instance) in the domain of the selected frame, the mouse pointer will change instead of this message being printed. */ ); - Vgc_message = build_string (gc_default_message); + Vgc_message = build_defer_string (gc_default_message); DEFVAR_LISP ("gc-pointer-glyph", &Vgc_pointer_glyph /* Pointer glyph used to indicate that a garbage collection is in progress.
--- a/src/glyphs-eimage.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/glyphs-eimage.c Tue Jan 26 23:22:30 2010 -0600 @@ -902,7 +902,8 @@ /* Something blew up: just display the error (cleanup happens in the unwind) */ signal_image_error_2 ("Error decoding PNG", - build_string(png_err_stct.err_str), + build_ext_string (png_err_stct.err_str, + Qerror_message_encoding), instantiator); } @@ -1300,7 +1301,8 @@ /* An error was signaled. No clean up is needed, as unwind handles that for us. Just pass the error along. */ signal_image_error_2 ("TIFF decoding error", - build_string(tiff_err_data.err_str), + build_ext_string (tiff_err_data.err_str, + Qerror_message_encoding), instantiator); } TIFFSetErrorHandler ((TIFFErrorHandler)tiff_error_func);
--- a/src/glyphs-gtk.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/glyphs-gtk.c Tue Jan 26 23:22:30 2010 -0600 @@ -362,7 +362,7 @@ if (IMAGE_INSTANCE_GTK_MASK (p)) write_fmt_string (printcharfun, "/0x%lx", (unsigned long) IMAGE_INSTANCE_GTK_MASK (p)); - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); break; #ifdef HAVE_SUBWINDOWS case IMAGE_SUBWINDOW:
--- a/src/glyphs-msw.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/glyphs-msw.c Tue Jan 26 23:22:30 2010 -0600 @@ -1724,7 +1724,7 @@ write_fmt_string (printcharfun, "/0x%lx", (unsigned long) IMAGE_INSTANCE_MSWINDOWS_MASK (p)); } - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); break; default:
--- a/src/glyphs-x.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/glyphs-x.c Tue Jan 26 23:22:30 2010 -0600 @@ -370,7 +370,7 @@ write_fmt_string (printcharfun, "/0x%lx", (unsigned long) IMAGE_INSTANCE_X_MASK (p)); } - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); break; default: break; @@ -2400,7 +2400,7 @@ if (!rf && !fs) warn_when_safe_lispobj (intern ("xft"), Qdebug, - Fcons (build_string ("missing font in update_widget_face"), + Fcons (build_msg_string ("missing font in update_widget_face"), Fface_name (face))); #endif }
--- a/src/glyphs.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/glyphs.c Tue Jan 26 23:22:30 2010 -0600 @@ -592,7 +592,7 @@ specbind (Qinhibit_quit, Qt); record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - temp_buffer = Fget_buffer_create (build_string (" *pixmap conversion*")); + temp_buffer = Fget_buffer_create (build_ascstring (" *pixmap conversion*")); GCPRO1 (temp_buffer); set_buffer_internal (XBUFFER (temp_buffer)); Ferase_buffer (Qnil); @@ -1032,37 +1032,37 @@ if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii)) || !NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii))) { - write_c_string (printcharfun, " @"); + write_ascstring (printcharfun, " @"); if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii))) write_fmt_string (printcharfun, "%ld", XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii))); else - write_c_string (printcharfun, "??"); - write_c_string (printcharfun, ","); + write_ascstring (printcharfun, "??"); + write_ascstring (printcharfun, ","); if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii))) write_fmt_string (printcharfun, "%ld", XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii))); else - write_c_string (printcharfun, "??"); + write_ascstring (printcharfun, "??"); } if (!NILP (IMAGE_INSTANCE_PIXMAP_FG (ii)) || !NILP (IMAGE_INSTANCE_PIXMAP_BG (ii))) { - write_c_string (printcharfun, " ("); + write_ascstring (printcharfun, " ("); if (!NILP (IMAGE_INSTANCE_PIXMAP_FG (ii))) { print_internal (XCOLOR_INSTANCE (IMAGE_INSTANCE_PIXMAP_FG (ii))->name, printcharfun, 0); } - write_c_string (printcharfun, "/"); + write_ascstring (printcharfun, "/"); if (!NILP (IMAGE_INSTANCE_PIXMAP_BG (ii))) { print_internal (XCOLOR_INSTANCE (IMAGE_INSTANCE_PIXMAP_BG (ii))->name, printcharfun, 0); } - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); } break; @@ -1086,17 +1086,17 @@ are specific to a particular frame so we want to print in their description what that frame is. */ - write_c_string (printcharfun, " on #<"); + write_ascstring (printcharfun, " on #<"); { struct frame* f = XFRAME (IMAGE_INSTANCE_FRAME (ii)); if (!FRAME_LIVE_P (f)) - write_c_string (printcharfun, "dead"); + write_ascstring (printcharfun, "dead"); else - write_c_string (printcharfun, + write_ascstring (printcharfun, DEVICE_TYPE_NAME (XDEVICE (FRAME_DEVICE (f)))); } - write_c_string (printcharfun, "-frame>"); + write_ascstring (printcharfun, "-frame>"); write_fmt_string (printcharfun, " 0x%p", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); @@ -2219,34 +2219,35 @@ /* error helpers */ /************************************************************************/ DOESNT_RETURN -signal_image_error (const CIbyte *reason, Lisp_Object frob) +signal_image_error (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qimage_conversion_error, reason, frob); } DOESNT_RETURN -signal_image_error_2 (const CIbyte *reason, Lisp_Object frob0, Lisp_Object frob1) +signal_image_error_2 (const Ascbyte *reason, Lisp_Object frob0, + Lisp_Object frob1) { signal_error_2 (Qimage_conversion_error, reason, frob0, frob1); } DOESNT_RETURN -signal_double_image_error (const CIbyte *string1, const CIbyte *string2, +signal_double_image_error (const Ascbyte *reason1, const Ascbyte *reason2, Lisp_Object data) { signal_error_1 (Qimage_conversion_error, - list3 (build_msg_string (string1), - build_msg_string (string2), + list3 (build_msg_string (reason1), + build_msg_string (reason2), data)); } DOESNT_RETURN -signal_double_image_error_2 (const CIbyte *string1, const CIbyte *string2, +signal_double_image_error_2 (const Ascbyte *reason1, const Ascbyte *reason2, Lisp_Object data1, Lisp_Object data2) { signal_error_1 (Qimage_conversion_error, - list4 (build_msg_string (string1), - build_msg_string (string2), + list4 (build_msg_string (reason1), + build_msg_string (reason2), data1, data2)); } @@ -2748,11 +2749,11 @@ { mask_file = MAYBE_LISP_CONTYPE_METH (decode_console_type(console_type, ERROR_ME), - locate_pixmap_file, (concat2 (file, build_string ("Mask")))); + locate_pixmap_file, (concat2 (file, build_ascstring ("Mask")))); if (NILP (mask_file)) mask_file = MAYBE_LISP_CONTYPE_METH (decode_console_type(console_type, ERROR_ME), - locate_pixmap_file, (concat2 (file, build_string ("msk")))); + locate_pixmap_file, (concat2 (file, build_ascstring ("msk")))); } if (!NILP (mask_file)) @@ -2957,7 +2958,7 @@ Lisp_Object retval = Qnil; struct buffer *old_buffer = current_buffer; Lisp_Object temp_buffer = - Fget_buffer_create (build_string (" *pixmap conversion*")); + Fget_buffer_create (build_ascstring (" *pixmap conversion*")); int elt; int height, width, ncolors; struct gcpro gcpro1, gcpro2, gcpro3;
--- a/src/glyphs.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/glyphs.h Tue Jan 26 23:22:30 2010 -0600 @@ -386,14 +386,16 @@ DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator, int given_dest_mask, int desired_dest_mask)); -DECLARE_DOESNT_RETURN (signal_image_error (const char *, Lisp_Object)); -DECLARE_DOESNT_RETURN (signal_image_error_2 (const char *, Lisp_Object, - Lisp_Object)); -DECLARE_DOESNT_RETURN (signal_double_image_error (const char *string1, - const char *string2, +DECLARE_DOESNT_RETURN (signal_image_error (const Ascbyte *reason, + Lisp_Object frob)); +DECLARE_DOESNT_RETURN (signal_image_error_2 (const Ascbyte *reason, + Lisp_Object frob0, + Lisp_Object frob1)); +DECLARE_DOESNT_RETURN (signal_double_image_error (const Ascbyte *reason1, + const Ascbyte *reason2, Lisp_Object data)); -DECLARE_DOESNT_RETURN (signal_double_image_error_2 (const char *string1, - const char *string2, +DECLARE_DOESNT_RETURN (signal_double_image_error_2 (const Ascbyte *reason1, + const Ascbyte *reason2, Lisp_Object data1, Lisp_Object data2));
--- a/src/gui.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/gui.c Tue Jan 26 23:22:30 2010 -0600 @@ -516,7 +516,7 @@ CHECK_STRING (suffix); } - retval = concat3 (pgui_item->name, build_string (" "), suffix); + retval = concat3 (pgui_item->name, build_ascstring (" "), suffix); } return retval;
--- a/src/hpplay.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/hpplay.c Tue Jan 26 23:22:30 2010 -0600 @@ -75,7 +75,7 @@ AGetErrorText (audio, errorCode, errorbuff, 131); EXTERNAL_TO_C_STRING (errorbuf, interr, Qerror_message_encoding); - signal_error (Qsound_error, text, build_string (interr)); + signal_error (Qsound_error, text, build_intstring (interr)); } long
--- a/src/intl-win32.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/intl-win32.c Tue Jan 26 23:22:30 2010 -0600 @@ -1,5 +1,5 @@ /* Win32 internationalization functions. - Copyright (C) 2000, 2001, 2002, 2004 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2004, 2010 Ben Wing. Copyright (C) 2000 IKEYAMA Tomonori. This file is part of XEmacs. @@ -650,7 +650,7 @@ for (i = 0; i < table_size; i++) if (code == table[i].code) - return build_string (table[i].string); + return build_ascstring (table[i].string); return Qnil; } @@ -668,7 +668,7 @@ if (!table[i].string) break; if (sublang == table[i].code) - return build_string (table[i].string); + return build_ascstring (table[i].string); } else if (!table[i].string && lang == table[i].code) found_lang = 1; @@ -677,11 +677,11 @@ switch (sublang) { case SUBLANG_NEUTRAL: - return build_string ("NEUTRAL"); + return build_ascstring ("NEUTRAL"); case SUBLANG_DEFAULT: - return build_string ("DEFAULT"); + return build_ascstring ("DEFAULT"); case SUBLANG_SYS_DEFAULT: - return build_string ("SYS_DEFAULT"); + return build_ascstring ("SYS_DEFAULT"); } return Qnil; @@ -1288,8 +1288,8 @@ { int got_abbrev; int got_full; - char abbrev_name[32] = { 0 }; - char full_name[256] = { 0 }; + Extbyte abbrev_name[32] = { 0 }; + Extbyte full_name[256] = { 0 }; CHECK_INT (lcid); @@ -1298,27 +1298,28 @@ if (NILP (longform)) { - got_abbrev = GetLocaleInfo (XINT (lcid), - LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP, - abbrev_name, sizeof (abbrev_name)); + got_abbrev = qxeGetLocaleInfo (XINT (lcid), + LOCALE_SABBREVLANGNAME | + LOCALE_USE_CP_ACP, + abbrev_name, sizeof (abbrev_name)); if (got_abbrev) - return build_string (abbrev_name); + return build_tstr_string (abbrev_name); } else if (EQ (longform, Qt)) { - got_full = GetLocaleInfo (XINT (lcid), - LOCALE_SLANGUAGE | LOCALE_USE_CP_ACP, - full_name, sizeof (full_name)); + got_full = qxeGetLocaleInfo (XINT (lcid), + LOCALE_SLANGUAGE | LOCALE_USE_CP_ACP, + full_name, sizeof (full_name)); if (got_full) - return build_string (full_name); + return build_tstr_string (full_name); } else if (NUMBERP (longform)) { - got_full = GetLocaleInfo (XINT (lcid), - XINT (longform), - full_name, sizeof (full_name)); + got_full = qxeGetLocaleInfo (XINT (lcid), + XINT (longform), + full_name, sizeof (full_name)); if (got_full) - return make_unibyte_string (full_name, got_full); + return build_tstr_string (full_name); } return Qnil; @@ -1703,7 +1704,7 @@ #ifdef MULE return lcid_to_locale (lcid); #else - return Fcons (build_string ("NEUTRAL"), build_string ("DEFAULT")); + return Fcons (build_ascstring ("NEUTRAL"), build_ascstring ("DEFAULT")); #endif } @@ -1866,7 +1867,7 @@ struct mswindows_multibyte_to_unicode_coding_system *data = XCODING_SYSTEM_TYPE_DATA (cs, mswindows_multibyte_to_unicode); - write_c_string (printcharfun, "("); + write_ascstring (printcharfun, "("); if (data->locale_type == MULTIBYTE_SPECIFIED_CODE_PAGE) print_internal (make_int (data->cp), printcharfun, 1); else @@ -1874,7 +1875,7 @@ write_fmt_string_lisp (printcharfun, "%s, ", 1, mswindows_multibyte_to_unicode_getprop (cs, Qlocale)); print_internal (mswindows_multibyte_to_unicode_getprop (cs, Qcode_page), printcharfun, 0); } - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); } /* ----------------------------------------------------------------------- */ @@ -2351,13 +2352,13 @@ { Fmake_coding_system_internal (Qmswindows_unicode, Qunicode, - build_msg_string ("MS Windows Unicode"), + build_defer_string ("MS Windows Unicode"), nconc2 (list4 (Qdocumentation, - build_msg_string ( + build_defer_string ( "Converts to the Unicode encoding for Windows API calls.\n" "This encoding is equivalent to standard UTF16, little-endian." ), - Qmnemonic, build_string ("MSW-U")), + Qmnemonic, build_ascstring ("MSW-U")), list4 (Qunicode_type, Qutf_16, Qlittle_endian, Qt)));
--- a/src/keymap.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/keymap.c Tue Jan 26 23:22:30 2010 -0600 @@ -290,7 +290,7 @@ Lisp_Keymap *keymap = XKEYMAP (obj); if (print_readably) printing_unreadable_lcrecord (obj, 0); - write_c_string (printcharfun, "#<keymap "); + write_ascstring (printcharfun, "#<keymap "); if (!NILP (keymap->name)) { write_fmt_string_lisp (printcharfun, "%S ", 1, keymap->name); @@ -1960,17 +1960,17 @@ if (EQ (keys, new_keys)) signal_ferror_with_frob (Qinvalid_operation, mpc_binding, "can't bind %s: %s has a non-keymap binding", - (char *) XSTRING_DATA (Fkey_description (keys)), - (char *) XSTRING_DATA (Fsingle_key_description - (Vmeta_prefix_char))); + (CIbyte *) XSTRING_DATA (Fkey_description (keys)), + (CIbyte *) XSTRING_DATA (Fsingle_key_description + (Vmeta_prefix_char))); else signal_ferror_with_frob (Qinvalid_operation, mpc_binding, "can't bind %s: %s %s has a non-keymap binding", - (char *) XSTRING_DATA (Fkey_description (keys)), - (char *) XSTRING_DATA (Fkey_description - (new_keys)), - (char *) XSTRING_DATA (Fsingle_key_description - (Vmeta_prefix_char))); + (CIbyte *) XSTRING_DATA (Fkey_description (keys)), + (CIbyte *) XSTRING_DATA (Fkey_description + (new_keys)), + (CIbyte *) XSTRING_DATA (Fsingle_key_description + (Vmeta_prefix_char))); } DEFUN ("define-key", Fdefine_key, 3, 3, 0, /* @@ -3497,7 +3497,7 @@ string = s2; else { - /* if (NILP (sep)) Lisp_Object sep = build_string (" ") */; + /* if (NILP (sep)) Lisp_Object sep = build_ascstring (" ") */; string = concat2 (string, concat2 (Vsingle_space_string, s2)); } } @@ -3655,7 +3655,7 @@ } *p = 0; - return build_string ((char *) buf); + return build_intstring (buf); }
--- a/src/lisp.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/lisp.h Tue Jan 26 23:22:30 2010 -0600 @@ -521,7 +521,8 @@ c) [Ascbyte] pure ASCII text d) [Binbyte] binary data that is not meant to be interpreted as text e) [Rawbyte] general data in memory, where we don't care about whether - it's text or binary + it's text or binary; often used when computing memory- + based/byte-based offsets of pointers f) [Boolbyte] a zero or a one g) [Bitbyte] a byte used for bit fields h) [Chbyte] null-semantics `char *'; used when casting an argument to @@ -2045,6 +2046,15 @@ Dynarr_declare (unsigned long); } unsigned_long_dynarr; +typedef const Ascbyte *const_Ascbyte_ptr; +typedef struct +{ + Dynarr_declare (const Ascbyte *); +} const_Ascbyte_ptr_dynarr; + +extern const struct sized_memory_description const_Ascbyte_ptr_description; +extern const struct sized_memory_description const_Ascbyte_ptr_dynarr_description; + typedef struct { Dynarr_declare (int); @@ -3835,22 +3845,100 @@ format it and store it in the `string-translatable' property of the returned string. See Fgettext(). - CGETTEXT() is the same as GETTEXT() but works with char * strings - instead of Ibyte * strings. - - build_msg_string() is a shorthand for build_string (GETTEXT (x)). - build_msg_intstring() is a shorthand for build_intstring (GETTEXT (x)). + The variations IGETTEXT, CIGETTEXT and ASCGETTEXT operate on + Ibyte *, CIbyte *, and Ascbyte * strings, respectively. The + ASCGETTEXT version has an assert check to verify that its string + really is pure-ASCII. Plain GETTEXT is defined as ASCGETTEXT, and + so works the same way. (There are no versions that work for Extbyte *. + Translate to internal format before working on it.) + + There are similar functions for building a Lisp string from a C + string and translating in the process. They again come in three + variants: build_msg_istring(), build_msg_cistring(), and + build_msg_ascstring(). Again, build_msg_ascstring() asserts that + its text is pure-ASCII, and build_msg_string() is the same as + build_msg_ascstring(). */ -#define GETTEXT(x) (x) -#define CGETTEXT(x) (x) -#define LISP_GETTEXT(x) (x) - -/* DEFER_GETTEXT is used to identify strings which are translated when - they are referenced instead of when they are defined. - These include Qerror_messages and initialized arrays of strings. +/* Return value NOT Ascbyte, because the result in general will have been + translated into a foreign language. */ +DECLARE_INLINE_HEADER (const CIbyte *ASCGETTEXT (const Ascbyte *s)) +{ + ASSERT_ASCTEXT_ASCII (s); + return s; +} + +DECLARE_INLINE_HEADER (const Ibyte *IGETTEXT (const Ibyte *s)) +{ + return s; +} + +DECLARE_INLINE_HEADER (const CIbyte *CIGETTEXT (const CIbyte *s)) +{ + return s; +} + +DECLARE_INLINE_HEADER (Lisp_Object LISP_GETTEXT (Lisp_Object s)) +{ + return s; +} + +#define GETTEXT ASCGETTEXT + +MODULE_API Lisp_Object build_msg_istring (const Ibyte *); +MODULE_API Lisp_Object build_msg_cistring (const CIbyte *); +MODULE_API Lisp_Object build_msg_ascstring (const Ascbyte *); +#define build_msg_string build_msg_ascstring + + +/* DEFER_GETTEXT() and variants are used to identify strings which are not + meant to be translated immediately, but instead at some later time. + This is used in strings that are stored somewhere at dump or + initialization time, at a time when the current language environment is + not set. It is the duty of the user of the string to call GETTEXT or + some variant at the appropriate time. DEFER_GETTTEXT() serves only as a + marker that the string is translatable, and will as a result be snarfed + during message snarfing (see above). + + build_defer_string() and variants are the deferred equivalents of + build_msg_string() and variants. Similarly to DEFER_GETTEXT(), they + don't actually do any translation, but serve as place markers for + message snarfing. However, they may do something more than just build + a Lisp string -- in particular, they may store a string property + indicating that the string is translatable (see discussion above about + this property). */ -#define DEFER_GETTEXT(x) (x) + +DECLARE_INLINE_HEADER (const Ascbyte *DEFER_ASCGETTEXT (const Ascbyte *s)) +{ + ASSERT_ASCTEXT_ASCII (s); + return s; +} + +DECLARE_INLINE_HEADER (const Ibyte *DEFER_IGETTEXT (const Ibyte *s)) +{ + return s; +} + +DECLARE_INLINE_HEADER (const CIbyte *DEFER_CIGETTEXT (const CIbyte *s)) +{ + return s; +} + +#define DEFER_GETTEXT DEFER_ASCGETTEXT + +MODULE_API Lisp_Object build_defer_istring (const Ibyte *); +MODULE_API Lisp_Object build_defer_cistring (const CIbyte *); +MODULE_API Lisp_Object build_defer_ascstring (const Ascbyte *); + +#define build_defer_string build_defer_ascstring + + +void write_msg_istring (Lisp_Object stream, const Ibyte *str); +void write_msg_cistring (Lisp_Object stream, const CIbyte *str); +void write_msg_ascstring (Lisp_Object stream, const Ascbyte *str); + +#define write_msg_string write_msg_ascstring /************************************************************************/ @@ -4142,18 +4230,14 @@ /* Help debug crashes gc-marking a staticpro'ed object. */ -MODULE_API void staticpro_1 (Lisp_Object *, Ascbyte *); -MODULE_API void staticpro_nodump_1 (Lisp_Object *, Ascbyte *); -/* g++ 4.3 complains about the conversion of const char to char. - These end up in a dynarray, so we would need to define a whole new class - of dynarray just to handle the const char stuff. - ####Check to see how hard this might be. */ -#define staticpro(ptr) staticpro_1 (ptr, (Ascbyte *) #ptr) -#define staticpro_nodump(ptr) staticpro_nodump_1 (ptr, (Ascbyte *) #ptr) +MODULE_API void staticpro_1 (Lisp_Object *, const Ascbyte *); +MODULE_API void staticpro_nodump_1 (Lisp_Object *, const Ascbyte *); +#define staticpro(ptr) staticpro_1 (ptr, #ptr) +#define staticpro_nodump(ptr) staticpro_nodump_1 (ptr, #ptr) #ifdef HAVE_SHLIB -MODULE_API void unstaticpro_nodump_1 (Lisp_Object *, Ascbyte *); -#define unstaticpro_nodump(ptr) unstaticpro_nodump_1 (ptr, (Ascbyte *) #ptr) +MODULE_API void unstaticpro_nodump_1 (Lisp_Object *, const Ascbyte *); +#define unstaticpro_nodump(ptr) unstaticpro_nodump_1 (ptr, #ptr) #endif #else @@ -4176,7 +4260,7 @@ extern Lisp_Object_dynarr *mcpros; #ifdef DEBUG_XEMACS /* Help debug crashes gc-marking a mcpro'ed object. */ -MODULE_API void mcpro_1 (Lisp_Object, char *); +MODULE_API void mcpro_1 (Lisp_Object, const Ascbyte *); #define mcpro(ptr) mcpro_1 (ptr, #ptr) #else /* not DEBUG_XEMACS */ /* Call mcpro (&var) to protect mc variable `var'. */ @@ -4276,9 +4360,8 @@ MODULE_API void copy_lisp_object (Lisp_Object dst, Lisp_Object src); MODULE_API Lisp_Object build_intstring (const Ibyte *); MODULE_API Lisp_Object build_string (const CIbyte *); +MODULE_API Lisp_Object build_ascstring (const Ascbyte *); MODULE_API Lisp_Object build_ext_string (const Extbyte *, Lisp_Object); -MODULE_API Lisp_Object build_msg_intstring (const Ibyte *); -MODULE_API Lisp_Object build_msg_string (const CIbyte *); MODULE_API Lisp_Object make_string (const Ibyte *, Bytecount); MODULE_API Lisp_Object make_ext_string (const Extbyte *, EMACS_INT, Lisp_Object); void init_string_ascii_begin (Lisp_Object string); @@ -4388,7 +4471,7 @@ EXFUN (Fbyte_code, 3); DECLARE_DOESNT_RETURN (invalid_byte_code - (const CIbyte *reason, Lisp_Object frob)); + (const Ascbyte *reason, Lisp_Object frob)); extern Lisp_Object Qbyte_code, Qinvalid_byte_code; @@ -4646,38 +4729,38 @@ const CIbyte *, ...) PRINTF_ARGS (4, 5); -Lisp_Object build_error_data (const CIbyte *reason, Lisp_Object frob); -DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, const CIbyte *, +Lisp_Object build_error_data (const Ascbyte *reason, Lisp_Object frob); +DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, const Ascbyte *, Lisp_Object)); -void maybe_signal_error (Lisp_Object, const CIbyte *, Lisp_Object, +void maybe_signal_error (Lisp_Object, const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); -Lisp_Object signal_continuable_error (Lisp_Object, const CIbyte *, +Lisp_Object signal_continuable_error (Lisp_Object, const Ascbyte *, Lisp_Object); -Lisp_Object maybe_signal_continuable_error (Lisp_Object, const CIbyte *, +Lisp_Object maybe_signal_continuable_error (Lisp_Object, const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); DECLARE_DOESNT_RETURN (signal_ferror_with_frob (Lisp_Object, Lisp_Object, - const CIbyte *, ...)) + const Ascbyte *, ...)) PRINTF_ARGS(3, 4); void maybe_signal_ferror_with_frob (Lisp_Object, Lisp_Object, Lisp_Object, Error_Behavior, - const CIbyte *, ...) PRINTF_ARGS (5, 6); + const Ascbyte *, ...) PRINTF_ARGS (5, 6); Lisp_Object signal_continuable_ferror_with_frob (Lisp_Object, Lisp_Object, - const CIbyte *, + const Ascbyte *, ...) PRINTF_ARGS (3, 4); Lisp_Object maybe_signal_continuable_ferror_with_frob (Lisp_Object, Lisp_Object, Lisp_Object, Error_Behavior, - const CIbyte *, ...) + const Ascbyte *, ...) PRINTF_ARGS (5, 6); -DECLARE_DOESNT_RETURN (signal_error_2 (Lisp_Object, const CIbyte *, +DECLARE_DOESNT_RETURN (signal_error_2 (Lisp_Object, const Ascbyte *, Lisp_Object, Lisp_Object)); -void maybe_signal_error_2 (Lisp_Object, const CIbyte *, Lisp_Object, +void maybe_signal_error_2 (Lisp_Object, const Ascbyte *, Lisp_Object, Lisp_Object, Lisp_Object, Error_Behavior); -Lisp_Object signal_continuable_error_2 (Lisp_Object, const CIbyte *, +Lisp_Object signal_continuable_error_2 (Lisp_Object, const Ascbyte *, Lisp_Object, Lisp_Object); -Lisp_Object maybe_signal_continuable_error_2 (Lisp_Object, const CIbyte *, +Lisp_Object maybe_signal_continuable_error_2 (Lisp_Object, const Ascbyte *, Lisp_Object, Lisp_Object, Lisp_Object, Error_Behavior); @@ -4690,57 +4773,57 @@ MODULE_API DECLARE_DOESNT_RETURN (signal_circular_property_list_error (Lisp_Object)); -DECLARE_DOESNT_RETURN (syntax_error (const CIbyte *reason, +DECLARE_DOESNT_RETURN (syntax_error (const Ascbyte *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (syntax_error_2 (const CIbyte *reason, +DECLARE_DOESNT_RETURN (syntax_error_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)); -void maybe_syntax_error (const CIbyte *, Lisp_Object, Lisp_Object, +void maybe_syntax_error (const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); -DECLARE_DOESNT_RETURN (sferror (const CIbyte *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (sferror_2 (const CIbyte *reason, Lisp_Object frob1, +DECLARE_DOESNT_RETURN (sferror (const Ascbyte *reason, Lisp_Object frob)); +DECLARE_DOESNT_RETURN (sferror_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)); -void maybe_sferror (const CIbyte *, Lisp_Object, Lisp_Object, +void maybe_sferror (const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); -MODULE_API DECLARE_DOESNT_RETURN (invalid_argument (const CIbyte *reason, +MODULE_API DECLARE_DOESNT_RETURN (invalid_argument (const Ascbyte *reason, Lisp_Object frob)); -MODULE_API DECLARE_DOESNT_RETURN (invalid_argument_2 (const CIbyte *reason, +MODULE_API DECLARE_DOESNT_RETURN (invalid_argument_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)); -void maybe_invalid_argument (const CIbyte *, Lisp_Object, Lisp_Object, +void maybe_invalid_argument (const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); -MODULE_API DECLARE_DOESNT_RETURN (invalid_operation (const CIbyte *reason, +MODULE_API DECLARE_DOESNT_RETURN (invalid_operation (const Ascbyte *reason, Lisp_Object frob)); -MODULE_API DECLARE_DOESNT_RETURN (invalid_operation_2 (const CIbyte *reason, +MODULE_API DECLARE_DOESNT_RETURN (invalid_operation_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)); -MODULE_API void maybe_invalid_operation (const CIbyte *, Lisp_Object, +MODULE_API void maybe_invalid_operation (const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); -DECLARE_DOESNT_RETURN (invalid_state (const CIbyte *reason, +DECLARE_DOESNT_RETURN (invalid_state (const Ascbyte *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (invalid_state_2 (const CIbyte *reason, +DECLARE_DOESNT_RETURN (invalid_state_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)); -void maybe_invalid_state (const CIbyte *, Lisp_Object, Lisp_Object, +void maybe_invalid_state (const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); -DECLARE_DOESNT_RETURN (invalid_change (const CIbyte *reason, +DECLARE_DOESNT_RETURN (invalid_change (const Ascbyte *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (invalid_change_2 (const CIbyte *reason, +DECLARE_DOESNT_RETURN (invalid_change_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)); -void maybe_invalid_change (const CIbyte *, Lisp_Object, Lisp_Object, +void maybe_invalid_change (const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); -MODULE_API DECLARE_DOESNT_RETURN (invalid_constant (const CIbyte *reason, +MODULE_API DECLARE_DOESNT_RETURN (invalid_constant (const Ascbyte *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (invalid_constant_2 (const CIbyte *reason, +DECLARE_DOESNT_RETURN (invalid_constant_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)); -void maybe_invalid_constant (const CIbyte *, Lisp_Object, Lisp_Object, +void maybe_invalid_constant (const Ascbyte *, Lisp_Object, Lisp_Object, Error_Behavior); -DECLARE_DOESNT_RETURN (wtaerror (const CIbyte *reason, Lisp_Object frob)); -MODULE_API DECLARE_DOESNT_RETURN (out_of_memory (const CIbyte *reason, +DECLARE_DOESNT_RETURN (wtaerror (const Ascbyte *reason, Lisp_Object frob)); +MODULE_API DECLARE_DOESNT_RETURN (out_of_memory (const Ascbyte *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (stack_overflow (const CIbyte *reason, +DECLARE_DOESNT_RETURN (stack_overflow (const Ascbyte *reason, Lisp_Object frob)); Lisp_Object signal_void_function_error (Lisp_Object); @@ -4914,7 +4997,7 @@ void do_autoload (Lisp_Object, Lisp_Object); /* GCPROs both arguments */ Lisp_Object un_autoload (Lisp_Object); void warn_when_safe_lispobj (Lisp_Object, Lisp_Object, Lisp_Object); -MODULE_API void warn_when_safe (Lisp_Object, Lisp_Object, const CIbyte *, +MODULE_API void warn_when_safe (Lisp_Object, Lisp_Object, const Ascbyte *, ...) PRINTF_ARGS (3, 4); extern int backtrace_with_internal_sections; @@ -5033,13 +5116,13 @@ void record_auto_save (void); void force_auto_save_soon (void); DECLARE_DOESNT_RETURN (report_error_with_errno (Lisp_Object errtype, - const CIbyte *string, + const Ascbyte *reason, Lisp_Object data)); DECLARE_DOESNT_RETURN (report_file_type_error (Lisp_Object errtype, Lisp_Object oserrmess, - const CIbyte *string, + const Ascbyte *reason, Lisp_Object data)); -DECLARE_DOESNT_RETURN (report_file_error (const CIbyte *, Lisp_Object)); +DECLARE_DOESNT_RETURN (report_file_error (const Ascbyte *, Lisp_Object)); Lisp_Object lisp_strerror (int); Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object); int internal_delete_file (Lisp_Object); @@ -5140,11 +5223,11 @@ int depth); int internal_equal (Lisp_Object, Lisp_Object, int); int internal_equalp (Lisp_Object obj1, Lisp_Object obj2, int depth); -Lisp_Object concat2 (Lisp_Object, Lisp_Object); -Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object vconcat2 (Lisp_Object, Lisp_Object); -Lisp_Object vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object nconc2 (Lisp_Object, Lisp_Object); +Lisp_Object MODULE_API concat2 (Lisp_Object, Lisp_Object); +Lisp_Object MODULE_API concat3 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object MODULE_API vconcat2 (Lisp_Object, Lisp_Object); +Lisp_Object MODULE_API vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object); +Lisp_Object MODULE_API nconc2 (Lisp_Object, Lisp_Object); Lisp_Object bytecode_nconc2 (Lisp_Object *); void check_losing_bytecode (const char *, Lisp_Object); @@ -5303,9 +5386,11 @@ /* NOTE: Do not call this with the data of a Lisp_String. Use princ. * Note: stream should be defaulted before calling * (eg Qnil means stdout, not Vstandard_output, etc) */ +MODULE_API void write_istring (Lisp_Object stream, const Ibyte *str); +/* Same goes for this function. */ MODULE_API void write_c_string (Lisp_Object stream, const CIbyte *str); /* Same goes for this function. */ -MODULE_API void write_string (Lisp_Object stream, const Ibyte *str); +MODULE_API void write_ascstring (Lisp_Object stream, const Ascbyte *str); /* Same goes for this function. */ void write_string_1 (Lisp_Object stream, const Ibyte *str, Bytecount size); void write_eistring (Lisp_Object stream, const Eistring *ei);
--- a/src/lread.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/lread.c Tue Jan 26 23:22:30 2010 -0600 @@ -593,7 +593,7 @@ fd = locate_file (Vload_path, file, ((!NILP (nosuffix)) ? Qnil : - build_string (load_ignore_elc_files ? ".el:" : + build_ascstring (load_ignore_elc_files ? ".el:" : ".elc:.el:")), &found, -1); @@ -1271,7 +1271,7 @@ /* Is it really necessary to gcpro path and str? It shouldn't be unless some caller has fucked up. There are known instances that - call us with build_string("foo:bar") as SUFFIXES, though. */ + call us with build_ascstring("foo:bar") as SUFFIXES, though. */ GCPRO4 (path, str, suffixes, suffixtab); /* if this filename has directory components, it's too complicated @@ -1872,7 +1872,7 @@ else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10; else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10; - args[0] = build_string ("?\\x%x"); + args[0] = build_ascstring ("?\\x%x"); args[1] = make_int (i); syntax_error ("Overlong hex character escape", Fformat (2, args)); @@ -2394,34 +2394,36 @@ Ichar c; Ichar permit_unicode = 0; - do { - c = reader_nextchar(readcharfun); - switch (c) { - /* #r:engine"my sexy raw string" -- raw string w/ flags*/ - /* case ':': */ - /* #ru"Hi there\u20AC \U000020AC" -- raw string, honouring Unicode. */ - case 'u': - case 'U': - permit_unicode = c; - continue; - - /* #r"my raw string" -- raw string */ - case '\"': - return read_string(readcharfun, '\"', 1, permit_unicode); - /* invalid syntax */ - default: - { - if (permit_unicode) + do + { + c = reader_nextchar (readcharfun); + switch (c) + { + /* #r:engine"my sexy raw string" -- raw string w/ flags*/ + /* case ':': */ + /* #ru"Hi there\u20AC \U000020AC" -- raw string, honouring Unicode. */ + case 'u': + case 'U': + permit_unicode = c; + continue; + + /* #r"my raw string" -- raw string */ + case '\"': + return read_string (readcharfun, '\"', 1, permit_unicode); + /* invalid syntax */ + default: { - unreadchar(readcharfun, permit_unicode); + if (permit_unicode) + { + unreadchar (readcharfun, permit_unicode); + } + unreadchar (readcharfun, c); + return Fsignal (Qinvalid_read_syntax, + list1 (build_msg_string + ("unrecognized raw string syntax"))); } - unreadchar(readcharfun, c); - return Fsignal(Qinvalid_read_syntax, - list1(build_string - ("unrecognized raw string syntax"))); - } - } - } while (1); + } + } while (1); } /* Read the next Lisp object from the stream READCHARFUN and return it. @@ -2580,7 +2582,7 @@ if (CONSP (tmp) && UNBOUNDP (XCAR (tmp))) free_cons (tmp); return Fsignal (Qinvalid_read_syntax, - list1 (build_string ("#"))); + list1 (build_ascstring ("#"))); } GCPRO1 (tmp); /* Read the intervals and their properties. */ @@ -2738,13 +2740,13 @@ make_int (n))); } return Fsignal (Qinvalid_read_syntax, - list1 (build_string ("#"))); + list1 (build_ascstring ("#"))); } default: { unreadchar (readcharfun, c); return Fsignal (Qinvalid_read_syntax, - list1 (build_string ("#"))); + list1 (build_ascstring ("#"))); } } } @@ -3120,7 +3122,7 @@ because that would make the directory absolute now. */ XCAR (XCAR (holding_cons)) = - concat2 (build_string ("../lisp/"), + concat2 (build_ascstring ("../lisp/"), Ffile_name_nondirectory (Vload_file_name_internal)); } @@ -3214,7 +3216,7 @@ make_byte_code_args[iii] = Qzero; else XCAR (make_byte_code_args[iii]) = - concat2 (build_string ("../lisp/"), + concat2 (build_ascstring ("../lisp/"), Ffile_name_nondirectory (Vload_file_name_internal)); } @@ -3255,7 +3257,7 @@ /* kludge: locate-file does not work for a null load-path, even if the file name is absolute. */ - Vload_path = Fcons (build_string (""), Qnil); + Vload_path = Fcons (build_ascstring (""), Qnil); /* This used to get initialized in init_lread because all streams got closed when dumping occurs. This is no longer true --
--- a/src/lrecord.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/lrecord.h Tue Jan 26 23:22:30 2010 -0600 @@ -721,7 +721,7 @@ ... }; - lisp_object_description is declared in alloc.c, like this: + lisp_object_description is declared in gc.c, like this: static const struct memory_description lisp_object_description_1[] = { { XD_LISP_OBJECT, 0 },
--- a/src/marker.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/marker.c Tue Jan 26 23:22:30 2010 -0600 @@ -62,9 +62,9 @@ if (print_readably) printing_unreadable_object ("#<marker 0x%lx>", (long) marker); - write_c_string (printcharfun, GETTEXT ("#<marker ")); + write_ascstring (printcharfun, GETTEXT ("#<marker ")); if (!marker->buffer) - write_c_string (printcharfun, GETTEXT ("in no buffer")); + write_ascstring (printcharfun, GETTEXT ("in no buffer")); else { write_fmt_string (printcharfun, "at %ld in ", @@ -72,7 +72,7 @@ print_internal (marker->buffer->name, printcharfun, 0); } if (marker->insertion_type) - write_c_string (printcharfun, " insertion-type=t"); + write_ascstring (printcharfun, " insertion-type=t"); write_fmt_string (printcharfun, " 0x%lx>", (long) marker); }
--- a/src/menubar-msw.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/menubar-msw.c Tue Jan 26 23:22:30 2010 -0600 @@ -138,7 +138,7 @@ right = gui_item_display_flush_right (gui_item); if (!NILP (right)) - return concat3 (left, build_string ("\t"), right); + return concat3 (left, build_ascstring ("\t"), right); else return left; }
--- a/src/menubar-x.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/menubar-x.c Tue Jan 26 23:22:30 2010 -0600 @@ -999,7 +999,7 @@ i++; write_fmt_string (Qexternal_debugging_output, "OPERATE (%d): ",i); print_internal (t, Qexternal_debugging_output, 1); - write_c_string (Qexternal_debugging_output, "\n"); + write_ascstring (Qexternal_debugging_output, "\n"); t = XEVENT_NEXT (t); } }
--- a/src/menubar.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/menubar.c Tue Jan 26 23:22:30 2010 -0600 @@ -456,8 +456,8 @@ * and this works fine. */ - Vblank_menubar = list1 (list2 (build_msg_string ("No active menubar"), - vector3 (build_string (""), Qnil, Qnil))); + Vblank_menubar = list1 (list2 (build_defer_string ("No active menubar"), + vector3 (build_ascstring (""), Qnil, Qnil))); staticpro (&Vblank_menubar); DEFVAR_BOOL ("popup-menu-titles", &popup_menu_titles /*
--- a/src/minibuf.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/minibuf.c Tue Jan 26 23:22:30 2010 -0600 @@ -990,11 +990,9 @@ at runtime instead of at load time. */ #endif Vminibuffer_zero - = Fget_buffer_create - (build_string (DEFER_GETTEXT (" *Minibuf-0*"))); + = Fget_buffer_create (build_ascstring (" *Minibuf-0*")); Vecho_area_buffer - = Fget_buffer_create - (build_string (DEFER_GETTEXT (" *Echo Area*"))); + = Fget_buffer_create (build_ascstring (" *Echo Area*")); } void
--- a/src/mule-charset.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/mule-charset.c Tue Jan 26 23:22:30 2010 -0600 @@ -628,7 +628,7 @@ name = Fmake_symbol (build_intstring (tempname)); /* Uninterned. */ } if (NILP (doc_string)) - doc_string = build_string (""); + doc_string = build_ascstring (""); if (NILP (registries)) registries = make_vector(0, Qnil); if (NILP (short_name)) @@ -1160,185 +1160,185 @@ make_charset (LEADING_BYTE_ASCII, Qascii, 1, CHARSET_TYPE_94, 1, 0, 'B', CHARSET_LEFT_TO_RIGHT, - build_string ("ASCII"), - build_msg_string ("ASCII"), - build_msg_string ("ASCII (ISO646 IRV)"), - vector1(build_string("iso8859-1")), 0, 0); + build_ascstring ("ASCII"), + build_defer_string ("ASCII"), + build_defer_string ("ASCII (ISO646 IRV)"), + vector1(build_ascstring("iso8859-1")), 0, 0); staticpro (&Vcharset_control_1); Vcharset_control_1 = make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, 2, CHARSET_TYPE_94, 1, 1, 0, CHARSET_LEFT_TO_RIGHT, - build_string ("C1"), - build_msg_string ("Control characters"), - build_msg_string ("Control characters 128-191"), - vector1(build_string("iso8859-1")), 0, 0); + build_ascstring ("C1"), + build_defer_string ("Control characters"), + build_defer_string ("Control characters 128-191"), + vector1(build_ascstring("iso8859-1")), 0, 0); staticpro (&Vcharset_latin_iso8859_1); Vcharset_latin_iso8859_1 = make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1, 2, CHARSET_TYPE_96, 1, 1, 'A', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-1"), - build_msg_string ("ISO8859-1 (Latin-1)"), - build_msg_string ("ISO8859-1 (Latin-1)"), - vector1(build_string("iso8859-1")), 0, 0); + build_ascstring ("Latin-1"), + build_defer_string ("ISO8859-1 (Latin-1)"), + build_defer_string ("ISO8859-1 (Latin-1)"), + vector1(build_ascstring("iso8859-1")), 0, 0); staticpro (&Vcharset_latin_iso8859_2); Vcharset_latin_iso8859_2 = make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2, 2, CHARSET_TYPE_96, 1, 1, 'B', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-2"), - build_msg_string ("ISO8859-2 (Latin-2)"), - build_msg_string ("ISO8859-2 (Latin-2)"), - vector1(build_string("iso8859-2")), 0, 0); + build_ascstring ("Latin-2"), + build_defer_string ("ISO8859-2 (Latin-2)"), + build_defer_string ("ISO8859-2 (Latin-2)"), + vector1(build_ascstring("iso8859-2")), 0, 0); staticpro (&Vcharset_latin_iso8859_3); Vcharset_latin_iso8859_3 = make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3, 2, CHARSET_TYPE_96, 1, 1, 'C', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-3"), - build_msg_string ("ISO8859-3 (Latin-3)"), - build_msg_string ("ISO8859-3 (Latin-3)"), - vector1(build_string("iso8859-3")), 0, 0); + build_ascstring ("Latin-3"), + build_defer_string ("ISO8859-3 (Latin-3)"), + build_defer_string ("ISO8859-3 (Latin-3)"), + vector1(build_ascstring("iso8859-3")), 0, 0); staticpro (&Vcharset_latin_iso8859_4); Vcharset_latin_iso8859_4 = make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4, 2, CHARSET_TYPE_96, 1, 1, 'D', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-4"), - build_msg_string ("ISO8859-4 (Latin-4)"), - build_msg_string ("ISO8859-4 (Latin-4)"), - vector1(build_string("iso8859-4")), 0, 0); + build_ascstring ("Latin-4"), + build_defer_string ("ISO8859-4 (Latin-4)"), + build_defer_string ("ISO8859-4 (Latin-4)"), + vector1(build_ascstring("iso8859-4")), 0, 0); staticpro (&Vcharset_thai_tis620); Vcharset_thai_tis620 = make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620, 2, CHARSET_TYPE_96, 1, 1, 'T', CHARSET_LEFT_TO_RIGHT, - build_string ("TIS620"), - build_msg_string ("TIS620 (Thai)"), - build_msg_string ("TIS620.2529 (Thai)"), - vector1(build_string("tis620.2529-1")), 0, 0); + build_ascstring ("TIS620"), + build_defer_string ("TIS620 (Thai)"), + build_defer_string ("TIS620.2529 (Thai)"), + vector1(build_ascstring("tis620.2529-1")), 0, 0); staticpro (&Vcharset_greek_iso8859_7); Vcharset_greek_iso8859_7 = make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7, 2, CHARSET_TYPE_96, 1, 1, 'F', CHARSET_LEFT_TO_RIGHT, - build_string ("ISO8859-7"), - build_msg_string ("ISO8859-7 (Greek)"), - build_msg_string ("ISO8859-7 (Greek)"), - vector1(build_string("iso8859-7")), 0, 0); + build_ascstring ("ISO8859-7"), + build_defer_string ("ISO8859-7 (Greek)"), + build_defer_string ("ISO8859-7 (Greek)"), + vector1(build_ascstring("iso8859-7")), 0, 0); staticpro (&Vcharset_arabic_iso8859_6); Vcharset_arabic_iso8859_6 = make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, 2, CHARSET_TYPE_96, 1, 1, 'G', CHARSET_RIGHT_TO_LEFT, - build_string ("ISO8859-6"), - build_msg_string ("ISO8859-6 (Arabic)"), - build_msg_string ("ISO8859-6 (Arabic)"), - vector1(build_string ("iso8859-6")), 0, 0); + build_ascstring ("ISO8859-6"), + build_defer_string ("ISO8859-6 (Arabic)"), + build_defer_string ("ISO8859-6 (Arabic)"), + vector1(build_ascstring ("iso8859-6")), 0, 0); staticpro (&Vcharset_hebrew_iso8859_8); Vcharset_hebrew_iso8859_8 = make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, 2, CHARSET_TYPE_96, 1, 1, 'H', CHARSET_RIGHT_TO_LEFT, - build_string ("ISO8859-8"), - build_msg_string ("ISO8859-8 (Hebrew)"), - build_msg_string ("ISO8859-8 (Hebrew)"), - vector1(build_string ("iso8859-8")), 0, 0); + build_ascstring ("ISO8859-8"), + build_defer_string ("ISO8859-8 (Hebrew)"), + build_defer_string ("ISO8859-8 (Hebrew)"), + vector1(build_ascstring ("iso8859-8")), 0, 0); staticpro (&Vcharset_katakana_jisx0201); Vcharset_katakana_jisx0201 = make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, 2, CHARSET_TYPE_94, 1, 1, 'I', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0201 Kana"), - build_msg_string ("JISX0201.1976 (Japanese Kana)"), - build_msg_string ("JISX0201.1976 Japanese Kana"), - vector1(build_string ("jisx0201.1976-0")), 0, 0); + build_ascstring ("JISX0201 Kana"), + build_defer_string ("JISX0201.1976 (Japanese Kana)"), + build_defer_string ("JISX0201.1976 Japanese Kana"), + vector1(build_ascstring ("jisx0201.1976-0")), 0, 0); staticpro (&Vcharset_latin_jisx0201); Vcharset_latin_jisx0201 = make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, 2, CHARSET_TYPE_94, 1, 0, 'J', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0201 Roman"), - build_msg_string ("JISX0201.1976 (Japanese Roman)"), - build_msg_string ("JISX0201.1976 Japanese Roman"), - vector1(build_string ("jisx0201.1976-0")), 0, 0); + build_ascstring ("JISX0201 Roman"), + build_defer_string ("JISX0201.1976 (Japanese Roman)"), + build_defer_string ("JISX0201.1976 Japanese Roman"), + vector1(build_ascstring ("jisx0201.1976-0")), 0, 0); staticpro (&Vcharset_cyrillic_iso8859_5); Vcharset_cyrillic_iso8859_5 = make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5, 2, CHARSET_TYPE_96, 1, 1, 'L', CHARSET_LEFT_TO_RIGHT, - build_string ("ISO8859-5"), - build_msg_string ("ISO8859-5 (Cyrillic)"), - build_msg_string ("ISO8859-5 (Cyrillic)"), - vector1(build_string ("iso8859-5")), 0, 0); + build_ascstring ("ISO8859-5"), + build_defer_string ("ISO8859-5 (Cyrillic)"), + build_defer_string ("ISO8859-5 (Cyrillic)"), + vector1(build_ascstring ("iso8859-5")), 0, 0); staticpro (&Vcharset_latin_iso8859_9); Vcharset_latin_iso8859_9 = make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9, 2, CHARSET_TYPE_96, 1, 1, 'M', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-5"), - build_msg_string ("ISO8859-9 (Latin-5)"), - build_msg_string ("ISO8859-9 (Latin-5)"), - vector1(build_string ("iso8859-9")), 0, 0); + build_ascstring ("Latin-5"), + build_defer_string ("ISO8859-9 (Latin-5)"), + build_defer_string ("ISO8859-9 (Latin-5)"), + vector1(build_ascstring ("iso8859-9")), 0, 0); staticpro (&Vcharset_latin_iso8859_15); Vcharset_latin_iso8859_15 = make_charset (LEADING_BYTE_LATIN_ISO8859_15, Qlatin_iso8859_15, 2, CHARSET_TYPE_96, 1, 1, 'b', CHARSET_LEFT_TO_RIGHT, - build_string ("Latin-9"), - build_msg_string ("ISO8859-15 (Latin-9)"), - build_msg_string ("ISO8859-15 (Latin-9)"), - vector1(build_string ("iso8859-15")), 0, 0); + build_ascstring ("Latin-9"), + build_defer_string ("ISO8859-15 (Latin-9)"), + build_defer_string ("ISO8859-15 (Latin-9)"), + vector1(build_ascstring ("iso8859-15")), 0, 0); staticpro (&Vcharset_japanese_jisx0208_1978); Vcharset_japanese_jisx0208_1978 = make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, 3, CHARSET_TYPE_94X94, 2, 0, '@', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0208.1978"), - build_msg_string ("JISX0208.1978 (Japanese)"), - build_msg_string + build_ascstring ("JISX0208.1978"), + build_defer_string ("JISX0208.1978 (Japanese)"), + build_defer_string ("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"), - vector2(build_string("jisx0208.1978-0"), - build_string("jisc6226.1978-0")), 0, 0); + vector2(build_ascstring("jisx0208.1978-0"), + build_ascstring("jisc6226.1978-0")), 0, 0); staticpro (&Vcharset_chinese_gb2312); Vcharset_chinese_gb2312 = make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, 3, CHARSET_TYPE_94X94, 2, 0, 'A', CHARSET_LEFT_TO_RIGHT, - build_string ("GB2312"), - build_msg_string ("GB2312)"), - build_msg_string ("GB2312 Chinese simplified"), - vector2(build_string("gb2312.1980-0"), - build_string("gb2312.80&gb8565.88-0")), 0, 0); + build_ascstring ("GB2312"), + build_defer_string ("GB2312)"), + build_defer_string ("GB2312 Chinese simplified"), + vector2(build_ascstring("gb2312.1980-0"), + build_ascstring("gb2312.80&gb8565.88-0")), 0, 0); staticpro (&Vcharset_japanese_jisx0208); Vcharset_japanese_jisx0208 = make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, 3, CHARSET_TYPE_94X94, 2, 0, 'B', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0208"), - build_msg_string ("JISX0208.1983/1990 (Japanese)"), - build_msg_string ("JISX0208.1983/1990 Japanese Kanji"), - vector2(build_string("jisx0208.1983-0"), - build_string("jisx0208.1990-0")), 0, 0); + build_ascstring ("JISX0208"), + build_defer_string ("JISX0208.1983/1990 (Japanese)"), + build_defer_string ("JISX0208.1983/1990 Japanese Kanji"), + vector2(build_ascstring("jisx0208.1983-0"), + build_ascstring("jisx0208.1990-0")), 0, 0); staticpro (&Vcharset_korean_ksc5601); Vcharset_korean_ksc5601 = make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601, 3, CHARSET_TYPE_94X94, 2, 0, 'C', CHARSET_LEFT_TO_RIGHT, - build_string ("KSC5601"), - build_msg_string ("KSC5601 (Korean"), - build_msg_string ("KSC5601 Korean Hangul and Hanja"), - vector1(build_string("ksc5601.1987-0")), 0, 0); + build_ascstring ("KSC5601"), + build_defer_string ("KSC5601 (Korean"), + build_defer_string ("KSC5601 Korean Hangul and Hanja"), + vector1(build_ascstring("ksc5601.1987-0")), 0, 0); staticpro (&Vcharset_japanese_jisx0212); Vcharset_japanese_jisx0212 = make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212, 3, CHARSET_TYPE_94X94, 2, 0, 'D', CHARSET_LEFT_TO_RIGHT, - build_string ("JISX0212"), - build_msg_string ("JISX0212 (Japanese)"), - build_msg_string ("JISX0212 Japanese Supplement"), - vector1(build_string("jisx0212.1990-0")), 0, 0); + build_ascstring ("JISX0212"), + build_defer_string ("JISX0212 (Japanese)"), + build_defer_string ("JISX0212 Japanese Supplement"), + vector1(build_ascstring("jisx0212.1990-0")), 0, 0); #define CHINESE_CNS_PLANE(n) "cns11643.1992-" n staticpro (&Vcharset_chinese_cns11643_1); @@ -1346,41 +1346,41 @@ make_charset (LEADING_BYTE_CHINESE_CNS11643_1, Qchinese_cns11643_1, 3, CHARSET_TYPE_94X94, 2, 0, 'G', CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-1"), - build_msg_string ("CNS11643-1 (Chinese traditional)"), - build_msg_string + build_ascstring ("CNS11643-1"), + build_defer_string ("CNS11643-1 (Chinese traditional)"), + build_defer_string ("CNS 11643 Plane 1 Chinese traditional"), - vector1(build_string (CHINESE_CNS_PLANE("1"))), 0, 0); + vector1(build_ascstring (CHINESE_CNS_PLANE("1"))), 0, 0); staticpro (&Vcharset_chinese_cns11643_2); Vcharset_chinese_cns11643_2 = make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2, 3, CHARSET_TYPE_94X94, 2, 0, 'H', CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-2"), - build_msg_string ("CNS11643-2 (Chinese traditional)"), - build_msg_string + build_ascstring ("CNS11643-2"), + build_defer_string ("CNS11643-2 (Chinese traditional)"), + build_defer_string ("CNS 11643 Plane 2 Chinese traditional"), - vector1(build_string (CHINESE_CNS_PLANE("2"))), 0, 0); + vector1(build_ascstring (CHINESE_CNS_PLANE("2"))), 0, 0); staticpro (&Vcharset_chinese_big5_1); Vcharset_chinese_big5_1 = make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1, 3, CHARSET_TYPE_94X94, 2, 0, '0', CHARSET_LEFT_TO_RIGHT, - build_string ("Big5"), - build_msg_string ("Big5 (Level-1)"), - build_msg_string + build_ascstring ("Big5"), + build_defer_string ("Big5 (Level-1)"), + build_defer_string ("Big5 Level-1 Chinese traditional"), - vector1(build_string ("big5.eten-0")), 0, 0); + vector1(build_ascstring ("big5.eten-0")), 0, 0); staticpro (&Vcharset_chinese_big5_2); Vcharset_chinese_big5_2 = make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, 3, CHARSET_TYPE_94X94, 2, 0, '1', CHARSET_LEFT_TO_RIGHT, - build_string ("Big5"), - build_msg_string ("Big5 (Level-2)"), - build_msg_string + build_ascstring ("Big5"), + build_defer_string ("Big5 (Level-2)"), + build_defer_string ("Big5 Level-2 Chinese traditional"), - vector1(build_string ("big5.eten-0")), 0, 0); + vector1(build_ascstring ("big5.eten-0")), 0, 0); #ifdef ENABLE_COMPOSITE_CHARS @@ -1392,10 +1392,10 @@ make_charset (LEADING_BYTE_COMPOSITE, Qcomposite, 3, CHARSET_TYPE_96X96, 2, 0, 0, CHARSET_LEFT_TO_RIGHT, - build_string ("Composite"), - build_msg_string ("Composite characters"), - build_msg_string ("Composite characters"), - vector1(build_string ("")), 0, 0); + build_ascstring ("Composite"), + build_defer_string ("Composite characters"), + build_defer_string ("Composite characters"), + vector1(build_ascstring ("")), 0, 0); #else /* We create a hack so that we have a way of storing ESC 0 and ESC 1 sequences as "characters", so that they will be output correctly. */ @@ -1404,9 +1404,9 @@ make_charset (LEADING_BYTE_COMPOSITE_REPLACEMENT, Qcomposite, 2, CHARSET_TYPE_96, 1, 1, '|', CHARSET_LEFT_TO_RIGHT, - build_string ("Composite hack"), - build_msg_string ("Composite characters hack"), - build_msg_string ("Composite characters hack"), - vector1(build_string ("")), 0, 0); + build_ascstring ("Composite hack"), + build_defer_string ("Composite characters hack"), + build_defer_string ("Composite characters hack"), + vector1(build_ascstring ("")), 0, 0); #endif /* ENABLE_COMPOSITE_CHARS */ }
--- a/src/mule-coding.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/mule-coding.c Tue Jan 26 23:22:30 2010 -0600 @@ -2928,16 +2928,16 @@ { int i; - write_c_string (printcharfun, "("); + write_ascstring (printcharfun, "("); for (i = 0; i < 4; i++) { Lisp_Object charset = coding_system_charset (cs, i); if (i > 0) - write_c_string (printcharfun, ", "); + write_ascstring (printcharfun, ", "); write_fmt_string (printcharfun, "g%d=", i); print_internal (CHARSETP (charset) ? XCHARSET_NAME (charset) : charset, printcharfun, 0); if (XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (cs, i)) - write_c_string (printcharfun, "(force)"); + write_ascstring (printcharfun, "(force)"); } #define FROB(prop) \ @@ -2969,7 +2969,7 @@ { write_fmt_string_lisp (printcharfun, ", output-charset-conversion=%s", 1, val); } - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); } } @@ -3740,7 +3740,7 @@ XCODING_SYSTEM_FIXED_WIDTH_QUERY_SKIP_CHARS(codesys)), XCODING_SYSTEM_FIXED_WIDTH_QUERY_SKIP_CHARS(codesys), (flags & QUERY_METHOD_IGNORE_INVALID_SEQUENCES ? - build_string("") : + build_ascstring("") : XCODING_SYSTEM_FIXED_WIDTH_INVALID_SEQUENCES_SKIP_CHARS (codesys)), fastmap, (int)(sizeof (fastmap))); @@ -3801,17 +3801,12 @@ if (flags & QUERY_METHOD_ERRORP) { - DECLARE_EISTRING (error_details); - - eicpy_ascii (error_details, "Cannot encode "); - eicat_lstr (error_details, - make_string_from_buffer (buf, fail_range_start, - pos - fail_range_start)); - eicat_ascii (error_details, " using coding system"); - - signal_error (Qtext_conversion_error, - (const CIbyte *)(eidata (error_details)), - XCODING_SYSTEM_NAME (codesys)); + signal_error_2 + (Qtext_conversion_error, + "Cannot encode using coding system", + make_string_from_buffer (buf, fail_range_start, + pos - fail_range_start), + XCODING_SYSTEM_NAME (codesys)); } if (NILP (result))
--- a/src/number.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/number.c Tue Jan 26 23:22:30 2010 -0600 @@ -53,9 +53,9 @@ bignum_print (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) { - CIbyte *bstr = bignum_to_string (XBIGNUM_DATA (obj), 10); - write_c_string (printcharfun, bstr); - xfree (bstr, CIbyte *); + Ascbyte *bstr = bignum_to_string (XBIGNUM_DATA (obj), 10); + write_ascstring (printcharfun, bstr); + xfree (bstr, Ascbyte *); } #ifdef NEW_GC @@ -178,7 +178,7 @@ int UNUSED (escapeflag)) { CIbyte *rstr = ratio_to_string (XRATIO_DATA (obj), 10); - write_c_string (printcharfun, rstr); + write_ascstring (printcharfun, rstr); xfree (rstr, CIbyte *); } @@ -281,8 +281,8 @@ bigfloat_print (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) { - CIbyte *fstr = bigfloat_to_string (XBIGFLOAT_DATA (obj), 10); - write_c_string (printcharfun, fstr); + Ascbyte *fstr = bigfloat_to_string (XBIGFLOAT_DATA (obj), 10); + write_ascstring (printcharfun, fstr); xfree (fstr, CIbyte *); }
--- a/src/objects-msw.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/objects-msw.c Tue Jan 26 23:22:30 2010 -0600 @@ -1016,11 +1016,11 @@ for (i = 0; i < countof (mswindows_X_color_map); i++) if (pcolor == (mswindows_X_color_map[i].colorref)) - return build_string (mswindows_X_color_map[i].name); + return build_ascstring (mswindows_X_color_map[i].name); sprintf (buf, "#%02X%02X%02X", GetRValue (color), GetGValue (color), GetBValue (color)); - return build_string (buf); + return build_ascstring (buf); } /* @@ -2242,7 +2242,7 @@ int i; for (i = 0; i < countof (mswindows_X_color_map); i++) - result = Fcons (build_string (mswindows_X_color_map[i].name), result); + result = Fcons (build_ascstring (mswindows_X_color_map[i].name), result); return Fnreverse (result); }
--- a/src/objects-tty.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/objects-tty.c Tue Jan 26 23:22:30 2010 -0600 @@ -332,7 +332,7 @@ tty_font_list (Lisp_Object UNUSED (pattern), Lisp_Object UNUSED (device), Lisp_Object UNUSED (maxnumber)) { - return list1 (build_string ("normal")); + return list1 (build_ascstring ("normal")); } #ifdef MULE @@ -388,7 +388,7 @@ if (NILP (charset)) return font; - return concat3 (font, build_string ("/"), + return concat3 (font, build_ascstring ("/"), Fsymbol_name (XCHARSET_NAME (charset))); }
--- a/src/objects-xlike-inc.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/objects-xlike-inc.c Tue Jan 26 23:22:30 2010 -0600 @@ -556,7 +556,7 @@ { /* OK, we fell off the end of the table */ warn_when_safe_lispobj (intern ("xft"), intern ("alert"), - list2 (build_string ("unchecked charset"), + list2 (build_ascstring ("unchecked charset"), charset)); /* default to "en" #### THIS IS WRONG, WRONG, WRONG!! @@ -822,7 +822,7 @@ Lisp_Object new_registries = make_vector(registries_len + 1, Qnil); XVECTOR_DATA(new_registries)[0] - = build_string(FALLBACK_ASCII_REGISTRY); + = build_ascstring(FALLBACK_ASCII_REGISTRY); memcpy(XVECTOR_DATA(new_registries) + 1, XVECTOR_DATA(registries),
--- a/src/print.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/print.c Tue Jan 26 23:22:30 2010 -0600 @@ -655,7 +655,7 @@ } void -write_string (Lisp_Object stream, const Ibyte *str) +write_istring (Lisp_Object stream, const Ibyte *str) { /* This function can GC */ write_string_1 (stream, str, qxestrlen (str)); @@ -665,7 +665,37 @@ write_c_string (Lisp_Object stream, const CIbyte *str) { /* This function can GC */ - write_string_1 (stream, (const Ibyte *) str, strlen (str)); + write_istring (stream, (const Ibyte *) str); +} + +void +write_ascstring (Lisp_Object stream, const Ascbyte *str) +{ + /* This function can GC */ + ASSERT_ASCTEXT_ASCII (str); + write_istring (stream, (const Ibyte *) str); +} + +void +write_msg_istring (Lisp_Object stream, const Ibyte *str) +{ + /* This function can GC */ + return write_istring (stream, IGETTEXT (str)); +} + +void +write_msg_cistring (Lisp_Object stream, const CIbyte *str) +{ + /* This function can GC */ + return write_msg_istring (stream, (const Ibyte *) str); +} + +void +write_msg_ascstring (Lisp_Object stream, const Ascbyte *str) +{ + /* This function can GC */ + ASSERT_ASCTEXT_ASCII (str); + return write_msg_istring (stream, (const Ibyte *) str); } void @@ -848,7 +878,7 @@ (stream)) { /* This function can GC */ - write_c_string (canonicalize_printcharfun (stream), "\n"); + write_ascstring (canonicalize_printcharfun (stream), "\n"); return Qt; } @@ -945,9 +975,9 @@ GCPRO2 (object, stream); stream = print_prepare (stream, &frame); - write_c_string (stream, "\n"); + write_ascstring (stream, "\n"); print_internal (object, stream, 1); - write_c_string (stream, "\n"); + write_ascstring (stream, "\n"); print_finish (stream, frame); UNGCPRO; return object; @@ -1023,7 +1053,7 @@ } while (!NILP (tail)) { - write_c_string (stream, first ? ": " : ", "); + write_ascstring (stream, first ? ": " : ", "); /* Most errors have an explanatory string as their first argument, and it looks better not to put the quotes around it. */ print_internal (Fcar (tail), stream, @@ -1043,7 +1073,7 @@ error_throw: if (NILP (method)) { - write_c_string (stream, GETTEXT ("Peculiar error ")); + write_ascstring (stream, GETTEXT ("Peculiar error ")); print_internal (error_object, stream, 1); return; } @@ -1331,12 +1361,12 @@ for (i = 0; i < last; i++) { Lisp_Object elt = XVECTOR_DATA (obj)[i]; - if (i != 0) write_c_string (printcharfun, " "); + if (i != 0) write_ascstring (printcharfun, " "); print_internal (elt, printcharfun, escapeflag); } UNGCPRO; if (last != len) - write_c_string (printcharfun, " ..."); + write_ascstring (printcharfun, " ..."); write_c_string (printcharfun, end); } @@ -1358,14 +1388,14 @@ { obj = XCAR (XCDR (obj)); GCPRO2 (obj, printcharfun); - write_c_string (printcharfun, "\'"); + write_ascstring (printcharfun, "\'"); UNGCPRO; print_internal (obj, printcharfun, escapeflag); return; } GCPRO2 (obj, printcharfun); - write_c_string (printcharfun, "("); + write_ascstring (printcharfun, "("); { int len; @@ -1378,20 +1408,20 @@ obj = XCDR (obj), len++) { if (len > 0) - write_c_string (printcharfun, " "); + write_ascstring (printcharfun, " "); if (EQ (obj, tortoise) && len > 0) { if (print_readably) printing_unreadable_object ("circular list"); else - write_c_string (printcharfun, "... <circular list>"); + write_ascstring (printcharfun, "... <circular list>"); break; } if (len & 1) tortoise = XCDR (tortoise); if (len > max) { - write_c_string (printcharfun, "..."); + write_ascstring (printcharfun, "..."); break; } print_internal (XCAR (obj), printcharfun, escapeflag); @@ -1399,12 +1429,12 @@ } if (!LISTP (obj)) { - write_c_string (printcharfun, " . "); + write_ascstring (printcharfun, " . "); print_internal (obj, printcharfun, escapeflag); } UNGCPRO; - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ")"); return; } @@ -1442,13 +1472,13 @@ /* This deals with GC-relocation and Mule. */ output_string (printcharfun, 0, obj, 0, bcmax); if (max < size) - write_c_string (printcharfun, " ..."); + write_ascstring (printcharfun, " ..."); } else { Bytecount i, last = 0; - write_c_string (printcharfun, "\""); + write_ascstring (printcharfun, "\""); for (i = 0; i < bcmax; i++) { Ibyte ch = string_byte (obj, i); @@ -1462,17 +1492,17 @@ } if (ch == '\n') { - write_c_string (printcharfun, "\\n"); + write_ascstring (printcharfun, "\\n"); } else { Ibyte temp[2]; - write_c_string (printcharfun, "\\"); + write_ascstring (printcharfun, "\\"); /* This is correct for Mule because the character is either \ or " */ temp[0] = string_byte (obj, i); temp[1] = '\0'; - write_string (printcharfun, temp); + write_istring (printcharfun, temp); } last = i + 1; } @@ -1483,20 +1513,20 @@ bcmax - last); } if (max < size) - write_c_string (printcharfun, " ..."); - write_c_string (printcharfun, "\""); + write_ascstring (printcharfun, " ..."); + write_ascstring (printcharfun, "\""); } UNGCPRO; } DOESNT_RETURN -printing_unreadable_object (const CIbyte *fmt, ...) +printing_unreadable_object (const Ascbyte *fmt, ...) { Lisp_Object obj; va_list args; va_start (args, fmt); - obj = emacs_vsprintf_string (CGETTEXT (fmt), args); + obj = emacs_vsprintf_string (GETTEXT (fmt), args); va_end (args); /* Fsignal GC-protects its args */ @@ -1678,9 +1708,9 @@ case Lisp_Type_Int_Even: case Lisp_Type_Int_Odd: { - char buf[DECIMAL_PRINT_SIZE (EMACS_INT)]; + Ascbyte buf[DECIMAL_PRINT_SIZE (EMACS_INT)]; long_to_string (buf, XINT (obj)); - write_c_string (printcharfun, buf); + write_ascstring (printcharfun, buf); break; } @@ -1884,7 +1914,7 @@ Ascbyte buf[DECIMAL_PRINT_SIZE (long) + 1]; *buf = '#'; long_to_string (buf + 1, i); - write_c_string (printcharfun, buf); + write_ascstring (printcharfun, buf); break; } if (i < print_depth - 1) /* Did we print something? */ @@ -1897,7 +1927,7 @@ if (INTP (Vprint_level) && print_depth > XINT (Vprint_level)) { - write_c_string (printcharfun, "..."); + write_ascstring (printcharfun, "..."); break; } } @@ -1929,10 +1959,10 @@ print_float (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) { - char pigbuf[350]; /* see comments in float_to_string */ + Ascbyte pigbuf[350]; /* see comments in float_to_string */ float_to_string (pigbuf, XFLOAT_DATA (obj)); - write_c_string (printcharfun, pigbuf); + write_ascstring (printcharfun, pigbuf); } void @@ -1968,9 +1998,9 @@ Lisp_Object tem = Fassq (obj, Vprint_gensym_alist); if (CONSP (tem)) { - write_c_string (printcharfun, "#"); + write_ascstring (printcharfun, "#"); print_internal (XCDR (tem), printcharfun, escapeflag); - write_c_string (printcharfun, "#"); + write_ascstring (printcharfun, "#"); UNGCPRO; return; } @@ -1988,12 +2018,12 @@ tem = make_int (1); Vprint_gensym_alist = Fcons (Fcons (obj, tem), Vprint_gensym_alist); - write_c_string (printcharfun, "#"); + write_ascstring (printcharfun, "#"); print_internal (tem, printcharfun, escapeflag); - write_c_string (printcharfun, "="); + write_ascstring (printcharfun, "="); } } - write_c_string (printcharfun, "#:"); + write_ascstring (printcharfun, "#:"); } /* Does it look like an integer or a float? */ @@ -2028,7 +2058,7 @@ from FSF. --hniksic */ confusing = isfloat_string ((char *) data); if (confusing) - write_c_string (printcharfun, "\\"); + write_ascstring (printcharfun, "\\"); } { @@ -2053,7 +2083,7 @@ case '[': case ']' : case '?' : if (i > last) output_string (printcharfun, 0, name, last, i - last); - write_c_string (printcharfun, "\\"); + write_ascstring (printcharfun, "\\"); last = i; } }
--- a/src/process-nt.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/process-nt.c Tue Jan 26 23:22:30 2010 -0600 @@ -693,11 +693,11 @@ */ static DOESNT_RETURN -mswindows_report_winsock_error (const char *string, Lisp_Object data, +mswindows_report_winsock_error (const Ascbyte *reason, Lisp_Object data, int errnum) { report_file_type_error (Qnetwork_error, mswindows_lisp_error (errnum), - string, data); + reason, data); } static void @@ -1313,7 +1313,8 @@ return host; if (address.sin_family == AF_INET) - return build_string (inet_ntoa (address.sin_addr)); + return build_ext_string (inet_ntoa (address.sin_addr), + Qunix_host_name_encoding); else return host; }
--- a/src/process-unix.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/process-unix.c Tue Jan 26 23:22:30 2010 -0600 @@ -1847,7 +1847,8 @@ return host; if (address.sin_family == AF_INET) - return build_string (inet_ntoa (address.sin_addr)); + return build_ext_string (inet_ntoa (address.sin_addr), + Qunix_host_name_encoding); else /* #### any clue what to do here? */ return host;
--- a/src/process.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/process.c Tue Jan 26 23:22:30 2010 -0600 @@ -159,15 +159,15 @@ else { int netp = network_connection_p (obj); - write_c_string (printcharfun, + write_ascstring (printcharfun, netp ? GETTEXT ("#<network connection ") : GETTEXT ("#<process ")); print_internal (process->name, printcharfun, 1); - write_c_string (printcharfun, (netp ? " " : " pid ")); + write_ascstring (printcharfun, (netp ? " " : " pid ")); print_internal (process->pid, printcharfun, 1); write_fmt_string_lisp (printcharfun, " state:%S", 1, process->status_symbol); MAYBE_PROCMETH (print_process_data, (process, printcharfun)); - write_c_string (printcharfun, ">"); + write_ascstring (printcharfun, ">"); } } @@ -454,15 +454,15 @@ /************************************************************************/ DOESNT_RETURN -report_process_error (const char *string, Lisp_Object data) +report_process_error (const Ascbyte *reason, Lisp_Object data) { - report_error_with_errno (Qprocess_error, string, data); + report_error_with_errno (Qprocess_error, reason, data); } DOESNT_RETURN -report_network_error (const char *string, Lisp_Object data) +report_network_error (const Ascbyte *reason, Lisp_Object data) { - report_error_with_errno (Qnetwork_error, string, data); + report_error_with_errno (Qnetwork_error, reason, data); } Lisp_Object @@ -479,12 +479,12 @@ name1 = name; for (i = 1; ; i++) { - char suffix[10]; + Ascbyte suffix[10]; Lisp_Object tem = Fget_process (name1); if (NILP (tem)) break; sprintf (suffix, "<%d>", i); - name1 = concat2 (name, build_string (suffix)); + name1 = concat2 (name, build_ascstring (suffix)); } name = name1; p->name = name; @@ -746,7 +746,7 @@ tem = Qnil; NGCPRO1 (tem); - locate_file (list1 (build_string ("")), program, Vlisp_EXEC_SUFFIXES, + locate_file (list1 (build_ascstring ("")), program, Vlisp_EXEC_SUFFIXES, &tem, X_OK); if (NILP (tem)) signal_error (Qprocess_error, "Searching for program", program); @@ -1574,7 +1574,7 @@ if (coredump) string2 = build_msg_string (" (core dumped)\n"); else - string2 = build_string ("\n"); + string2 = build_ascstring ("\n"); set_string_char (string, 0, DOWNCASE (0, string_ichar (string, 0))); return concat2 (string, string2); @@ -1587,7 +1587,7 @@ if (coredump) string2 = build_msg_string (" (core dumped)\n"); else - string2 = build_string ("\n"); + string2 = build_ascstring ("\n"); return concat2 (build_msg_string ("exited abnormally with code "), concat2 (string, string2)); } @@ -2308,14 +2308,14 @@ ) { XCAR (scan) = concat3 (make_string (var, varlen), - build_string ("="), + build_ascstring ("="), make_string (value, valuelen)); return; } } Vprocess_environment = Fcons (concat3 (make_string (var, varlen), - build_string ("="), + build_ascstring ("="), make_string (value, valuelen)), Vprocess_environment); } @@ -2605,7 +2605,7 @@ the operations needing this are lower level than what ELisp programs typically do, and in any case no equivalent exists under native MS Windows. */ ); - Vnull_device = build_string (NULL_DEVICE); + Vnull_device = build_ascstring (NULL_DEVICE); DEFVAR_LISP ("process-connection-type", &Vprocess_connection_type /* Control type of device used to communicate with subprocesses. @@ -2685,6 +2685,6 @@ when Emacs starts. */ ); - Vlisp_EXEC_SUFFIXES = build_string (EXEC_SUFFIXES); + Vlisp_EXEC_SUFFIXES = build_ascstring (EXEC_SUFFIXES); staticpro (&Vlisp_EXEC_SUFFIXES); }
--- a/src/process.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/process.h Tue Jan 26 23:22:30 2010 -0600 @@ -55,8 +55,8 @@ EXFUN (Fprocess_id, 1); MODULE_API -DECLARE_DOESNT_RETURN (report_process_error (const char *, Lisp_Object)); -DECLARE_DOESNT_RETURN (report_network_error (const char *, Lisp_Object)); +DECLARE_DOESNT_RETURN (report_process_error (const Ascbyte *, Lisp_Object)); +DECLARE_DOESNT_RETURN (report_network_error (const Ascbyte *, Lisp_Object)); extern Lisp_Object Vlisp_EXEC_SUFFIXES; MODULE_API Ibyte *egetenv (const CIbyte *var);
--- a/src/profile.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/profile.c Tue Jan 26 23:22:30 2010 -0600 @@ -683,28 +683,28 @@ profiling_lock = 0; #ifdef DEBUG_XEMACS - QSin_temp_spot_1 = build_msg_string ("(in temp spot 1)"); + QSin_temp_spot_1 = build_defer_string ("(in temp spot 1)"); staticpro (&QSin_temp_spot_1); - QSin_temp_spot_2 = build_msg_string ("(in temp spot 2)"); + QSin_temp_spot_2 = build_defer_string ("(in temp spot 2)"); staticpro (&QSin_temp_spot_2); - QSin_temp_spot_3 = build_msg_string ("(in temp spot 3)"); + QSin_temp_spot_3 = build_defer_string ("(in temp spot 3)"); staticpro (&QSin_temp_spot_3); - QSin_temp_spot_4 = build_msg_string ("(in temp spot 4)"); + QSin_temp_spot_4 = build_defer_string ("(in temp spot 4)"); staticpro (&QSin_temp_spot_4); - QSin_temp_spot_5 = build_msg_string ("(in temp spot 5)"); + QSin_temp_spot_5 = build_defer_string ("(in temp spot 5)"); staticpro (&QSin_temp_spot_5); #endif /* DEBUG_XEMACS */ - QSunknown = build_msg_string ("(unknown)"); + QSunknown = build_defer_string ("(unknown)"); staticpro (&QSunknown); QSprocessing_events_at_top_level = - build_msg_string ("(processing events at top level)"); + build_defer_string ("(processing events at top level)"); staticpro (&QSprocessing_events_at_top_level); - QSprofile_overhead = build_msg_string ("(profile overhead)"); + QSprofile_overhead = build_defer_string ("(profile overhead)"); staticpro (&QSprofile_overhead); DEFSYMBOL (Qtiming);
--- a/src/rangetab.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/rangetab.c Tue Jan 26 23:22:30 2010 -0600 @@ -107,13 +107,13 @@ write_fmt_string_lisp (printcharfun, "#s(range-table type %s data (", 1, range_table_type_to_symbol (rt->type)); else - write_c_string (printcharfun, "#<range-table "); + write_ascstring (printcharfun, "#<range-table "); for (i = 0; i < Dynarr_length (rt->entries); i++) { struct range_table_entry *rte = Dynarr_atp (rt->entries, i); int so, ec; if (i > 0) - write_c_string (printcharfun, " "); + write_ascstring (printcharfun, " "); switch (rt->type) { case RANGE_START_CLOSED_END_OPEN: so = 0, ec = 0; break; @@ -131,7 +131,7 @@ print_internal (rte->val, printcharfun, 1); } if (print_readably) - write_c_string (printcharfun, "))"); + write_ascstring (printcharfun, "))"); else write_fmt_string (printcharfun, " 0x%x>", rt->header.uid); }
--- a/src/realpath.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/realpath.c Tue Jan 26 23:22:30 2010 -0600 @@ -464,6 +464,6 @@ vars_of_realpath (void) { QSin_qxe_realpath = - build_msg_string ("(in qxe_realpath)"); + build_defer_string ("(in qxe_realpath)"); staticpro (&QSin_qxe_realpath); }
--- a/src/redisplay.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/redisplay.c Tue Jan 26 23:22:30 2010 -0600 @@ -9843,7 +9843,7 @@ void vars_of_redisplay (void) { - QSin_redisplay = build_msg_string ("(in redisplay)"); + QSin_redisplay = build_defer_string ("(in redisplay)"); staticpro (&QSin_redisplay); Vpost_redisplay_actions = Qnil;
--- a/src/search.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/search.c Tue Jan 26 23:22:30 2010 -0600 @@ -2199,7 +2199,7 @@ } if (WORD_SYNTAX_P (syntax_table, string_ichar (string, len - 1))) word_count++; - if (!word_count) return build_string (""); + if (!word_count) return build_ascstring (""); { /* The following value is an upper bound on the amount of storage we @@ -2857,7 +2857,7 @@ /* replacement can be nil. */ if (NILP (replacement)) - replacement = build_string (""); + replacement = build_ascstring (""); if (case_action == all_caps) replacement = Fupcase (replacement, buffer);
--- a/src/sheap.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/sheap.c Tue Jan 26 23:22:30 2010 -0600 @@ -111,7 +111,7 @@ if (stream == NULL) report_file_error ("Opening sheap adjustment file", - build_string ("sheap-adjust.h")); + build_ascstring ("sheap-adjust.h")); fprintf (stream, "/*\tDo not edit this file!\n"
--- a/src/sound.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/sound.c Tue Jan 26 23:22:30 2010 -0600 @@ -98,9 +98,9 @@ Lisp_Object Qsound_error; DOESNT_RETURN -report_sound_error (const Ascbyte *string, Lisp_Object data) +report_sound_error (const Ascbyte *reason, Lisp_Object data) { - report_error_with_errno (Qsound_error, string, data); + report_error_with_errno (Qsound_error, reason, data); } DEFUN ("play-sound-file", Fplay_sound_file, 1, 3, "fSound file name: ", /*
--- a/src/specifier.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/specifier.c Tue Jan 26 23:22:30 2010 -0600 @@ -285,7 +285,7 @@ the_specs = Fspecifier_specs (obj, Qglobal, Qnil, Qnil); if (NILP (the_specs)) /* there are no global specs */ - write_c_string (printcharfun, "<unspecified>"); + write_ascstring (printcharfun, "<unspecified>"); else print_internal (the_specs, printcharfun, 1); if (!NILP (sp->fallback))
--- a/src/symbols.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/symbols.c Tue Jan 26 23:22:30 2010 -0600 @@ -731,7 +731,7 @@ */ (subr)) { - const char *name; + const Ascbyte *name; CHECK_SUBR (subr); name = XSUBR (subr)->name; @@ -1182,29 +1182,29 @@ return *((Lisp_Object *)symbol_value_forward_forward (fwd)); case SYMVAL_DEFAULT_BUFFER_FORWARD: - return (*((Lisp_Object *)((char *) XBUFFER (Vbuffer_defaults) - + ((char *)symbol_value_forward_forward (fwd) - - (char *)&buffer_local_flags)))); + return (*((Lisp_Object *)((Rawbyte *) XBUFFER (Vbuffer_defaults) + + ((Rawbyte *)symbol_value_forward_forward (fwd) + - (Rawbyte *)&buffer_local_flags)))); case SYMVAL_CURRENT_BUFFER_FORWARD: case SYMVAL_CONST_CURRENT_BUFFER_FORWARD: assert (buffer); - return (*((Lisp_Object *)((char *)buffer - + ((char *)symbol_value_forward_forward (fwd) - - (char *)&buffer_local_flags)))); + return (*((Lisp_Object *)((Rawbyte *)buffer + + ((Rawbyte *)symbol_value_forward_forward (fwd) + - (Rawbyte *)&buffer_local_flags)))); case SYMVAL_DEFAULT_CONSOLE_FORWARD: - return (*((Lisp_Object *)((char *) XCONSOLE (Vconsole_defaults) - + ((char *)symbol_value_forward_forward (fwd) - - (char *)&console_local_flags)))); + return (*((Lisp_Object *)((Rawbyte *) XCONSOLE (Vconsole_defaults) + + ((Rawbyte *)symbol_value_forward_forward (fwd) + - (Rawbyte *)&console_local_flags)))); case SYMVAL_SELECTED_CONSOLE_FORWARD: case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD: assert (console); - return (*((Lisp_Object *)((char *)console - + ((char *)symbol_value_forward_forward (fwd) - - (char *)&console_local_flags)))); + return (*((Lisp_Object *)((Rawbyte *)console + + ((Rawbyte *)symbol_value_forward_forward (fwd) + - (Rawbyte *)&console_local_flags)))); case SYMVAL_UNBOUND_MARKER: return valcontents; @@ -1230,13 +1230,13 @@ Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt); const struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); - int offset = ((char *) symbol_value_forward_forward (fwd) - - (char *) &buffer_local_flags); + int offset = ((Rawbyte *) symbol_value_forward_forward (fwd) + - (Rawbyte *) &buffer_local_flags); int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object, int flags) = symbol_value_forward_magicfun (fwd); - *((Lisp_Object *) (offset + (char *) XBUFFER (Vbuffer_defaults))) + *((Lisp_Object *) (offset + (Rawbyte *) XBUFFER (Vbuffer_defaults))) = value; if (mask > 0) /* Not always per-buffer */ @@ -1249,7 +1249,7 @@ { if (magicfun) magicfun (sym, &value, wrap_buffer (b), 0); - *((Lisp_Object *) (offset + (char *) b)) = value; + *((Lisp_Object *) (offset + (Rawbyte *) b)) = value; } } } @@ -1270,13 +1270,13 @@ Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt); const struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); - int offset = ((char *) symbol_value_forward_forward (fwd) - - (char *) &console_local_flags); + int offset = ((Rawbyte *) symbol_value_forward_forward (fwd) + - (Rawbyte *) &console_local_flags); int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object, int flags) = symbol_value_forward_magicfun (fwd); - *((Lisp_Object *) (offset + (char *) XCONSOLE (Vconsole_defaults))) + *((Lisp_Object *) (offset + (Rawbyte *) XCONSOLE (Vconsole_defaults))) = value; if (mask > 0) /* Not always per-console */ @@ -1289,7 +1289,7 @@ { if (magicfun) magicfun (sym, &value, console, 0); - *((Lisp_Object *) (offset + (char *) d)) = value; + *((Lisp_Object *) (offset + (Rawbyte *) d)) = value; } } } @@ -1366,9 +1366,9 @@ case SYMVAL_CURRENT_BUFFER_FORWARD: if (magicfun) magicfun (sym, &newval, wrap_buffer (current_buffer), 0); - *((Lisp_Object *) ((char *) current_buffer - + ((char *) symbol_value_forward_forward (fwd) - - (char *) &buffer_local_flags))) + *((Lisp_Object *) ((Rawbyte *) current_buffer + + ((Rawbyte *) symbol_value_forward_forward (fwd) + - (Rawbyte *) &buffer_local_flags))) = newval; return; @@ -1379,9 +1379,9 @@ case SYMVAL_SELECTED_CONSOLE_FORWARD: if (magicfun) magicfun (sym, &newval, Vselected_console, 0); - *((Lisp_Object *) ((char *) XCONSOLE (Vselected_console) - + ((char *) symbol_value_forward_forward (fwd) - - (char *) &console_local_flags))) + *((Lisp_Object *) ((Rawbyte *) XCONSOLE (Vselected_console) + + ((Rawbyte *) symbol_value_forward_forward (fwd) + - (Rawbyte *) &console_local_flags))) = newval; return; @@ -2058,18 +2058,18 @@ { const struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); - return (*((Lisp_Object *)((char *) XBUFFER (Vbuffer_defaults) - + ((char *)symbol_value_forward_forward (fwd) - - (char *)&buffer_local_flags)))); + return (*((Lisp_Object *)((Rawbyte *) XBUFFER (Vbuffer_defaults) + + ((Rawbyte *)symbol_value_forward_forward (fwd) + - (Rawbyte *)&buffer_local_flags)))); } case SYMVAL_SELECTED_CONSOLE_FORWARD: { const struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); - return (*((Lisp_Object *)((char *) XCONSOLE (Vconsole_defaults) - + ((char *)symbol_value_forward_forward (fwd) - - (char *)&console_local_flags)))); + return (*((Lisp_Object *)((Rawbyte *) XCONSOLE (Vconsole_defaults) + + ((Rawbyte *)symbol_value_forward_forward (fwd) + - (Rawbyte *)&console_local_flags)))); } case SYMVAL_BUFFER_LOCAL: @@ -2505,8 +2505,8 @@ { const struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); - int offset = ((char *) symbol_value_forward_forward (fwd) - - (char *) &buffer_local_flags); + int offset = ((Rawbyte *) symbol_value_forward_forward (fwd) + - (Rawbyte *) &buffer_local_flags); int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); @@ -2516,10 +2516,10 @@ Lisp_Object in_object, int flags) = symbol_value_forward_magicfun (fwd); Lisp_Object oldval = * (Lisp_Object *) - (offset + (char *) XBUFFER (Vbuffer_defaults)); + (offset + (Rawbyte *) XBUFFER (Vbuffer_defaults)); if (magicfun) (magicfun) (variable, &oldval, wrap_buffer (current_buffer), 0); - *(Lisp_Object *) (offset + (char *) current_buffer) + *(Lisp_Object *) (offset + (Rawbyte *) current_buffer) = oldval; current_buffer->local_var_flags &= ~mask; } @@ -2599,8 +2599,8 @@ { const struct symbol_value_forward *fwd = XSYMBOL_VALUE_FORWARD (valcontents); - int offset = ((char *) symbol_value_forward_forward (fwd) - - (char *) &console_local_flags); + int offset = ((Rawbyte *) symbol_value_forward_forward (fwd) + - (Rawbyte *) &console_local_flags); int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd))); @@ -2610,10 +2610,10 @@ Lisp_Object in_object, int flags) = symbol_value_forward_magicfun (fwd); Lisp_Object oldval = * (Lisp_Object *) - (offset + (char *) XCONSOLE (Vconsole_defaults)); + (offset + (Rawbyte *) XCONSOLE (Vconsole_defaults)); if (magicfun) magicfun (variable, &oldval, Vselected_console, 0); - *(Lisp_Object *) (offset + (char *) XCONSOLE (Vselected_console)) + *(Lisp_Object *) (offset + (Rawbyte *) XCONSOLE (Vselected_console)) = oldval; XCONSOLE (Vselected_console)->local_var_flags &= ~mask; } @@ -3590,7 +3590,7 @@ } static void -defsymbol_massage_name_1 (Lisp_Object *location, const char *name, int dump_p, +defsymbol_massage_name_1 (Lisp_Object *location, const Ascbyte *name, int dump_p, int multiword_predicate_p) { char temp[500]; @@ -3618,32 +3618,32 @@ } void -defsymbol_massage_name_nodump (Lisp_Object *location, const char *name) +defsymbol_massage_name_nodump (Lisp_Object *location, const Ascbyte *name) { defsymbol_massage_name_1 (location, name, 0, 0); } void -defsymbol_massage_name (Lisp_Object *location, const char *name) +defsymbol_massage_name (Lisp_Object *location, const Ascbyte *name) { defsymbol_massage_name_1 (location, name, 1, 0); } void defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location, - const char *name) + const Ascbyte *name) { defsymbol_massage_name_1 (location, name, 0, 1); } void -defsymbol_massage_multiword_predicate (Lisp_Object *location, const char *name) +defsymbol_massage_multiword_predicate (Lisp_Object *location, const Ascbyte *name) { defsymbol_massage_name_1 (location, name, 1, 1); } void -defsymbol_nodump (Lisp_Object *location, const char *name) +defsymbol_nodump (Lisp_Object *location, const Ascbyte *name) { *location = Fintern (make_string_nocopy ((const Ibyte *) name, strlen (name)), @@ -3652,7 +3652,7 @@ } void -defsymbol (Lisp_Object *location, const char *name) +defsymbol (Lisp_Object *location, const Ascbyte *name) { *location = Fintern (make_string_nocopy ((const Ibyte *) name, strlen (name)), @@ -3661,14 +3661,14 @@ } void -defkeyword (Lisp_Object *location, const char *name) +defkeyword (Lisp_Object *location, const Ascbyte *name) { defsymbol (location, name); Fset (*location, *location); } void -defkeyword_massage_name (Lisp_Object *location, const char *name) +defkeyword_massage_name (Lisp_Object *location, const Ascbyte *name) { char temp[500]; int len = strlen (name); @@ -3761,7 +3761,7 @@ \ newsubr = xnew (Lisp_Subr); \ memcpy (newsubr, subr, sizeof (Lisp_Subr)); \ - subr->doc = (const char *)newsubr; \ + subr->doc = (const CIbyte *)newsubr; \ subr = newsubr; \ } \ } while (0) @@ -3848,7 +3848,7 @@ } static void -deferror_1 (Lisp_Object *symbol, const char *name, const char *messuhhj, +deferror_1 (Lisp_Object *symbol, const Ascbyte *name, const Ascbyte *messuhhj, Lisp_Object inherits_from, int massage_p) { Lisp_Object conds; @@ -3863,25 +3863,25 @@ /* NOT build_msg_string (). This function is called at load time and the string needs to get translated at run time. (This happens in the function (display-error) in cmdloop.el.) */ - Fput (*symbol, Qerror_message, build_msg_string (messuhhj)); + Fput (*symbol, Qerror_message, build_defer_string (messuhhj)); } void -deferror (Lisp_Object *symbol, const char *name, const char *messuhhj, +deferror (Lisp_Object *symbol, const Ascbyte *name, const Ascbyte *messuhhj, Lisp_Object inherits_from) { deferror_1 (symbol, name, messuhhj, inherits_from, 0); } void -deferror_massage_name (Lisp_Object *symbol, const char *name, - const char *messuhhj, Lisp_Object inherits_from) +deferror_massage_name (Lisp_Object *symbol, const Ascbyte *name, + const Ascbyte *messuhhj, Lisp_Object inherits_from) { deferror_1 (symbol, name, messuhhj, inherits_from, 1); } void -deferror_massage_name_and_message (Lisp_Object *symbol, const char *name, +deferror_massage_name_and_message (Lisp_Object *symbol, const Ascbyte *name, Lisp_Object inherits_from) { char temp[500]; @@ -3985,7 +3985,8 @@ /* Create and initialize a Lisp variable whose value is forwarded to C data */ void -defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic) +defvar_magic (const Ascbyte *symbol_name, + const struct symbol_value_forward *magic) { Lisp_Object sym; @@ -3997,7 +3998,7 @@ */ if (initialized) { - sym = Fintern (build_string (symbol_name), Qnil); + sym = Fintern (build_ascstring (symbol_name), Qnil); LOADHIST_ATTACH (sym); } else
--- a/src/symeval.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/symeval.h Tue Jan 26 23:22:30 2010 -0600 @@ -326,16 +326,16 @@ #endif /* not NEW_GC */ MODULE_API void defsymbol_massage_name (Lisp_Object *location, - const char *name); + const Ascbyte *name); MODULE_API void defsymbol_massage_name_nodump (Lisp_Object *location, - const char *name); + const Ascbyte *name); MODULE_API void defsymbol_massage_multiword_predicate (Lisp_Object *location, - const char *name); + const Ascbyte *name); MODULE_API void defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location, - const char *name); -MODULE_API void defsymbol (Lisp_Object *location, const char *name); -MODULE_API void defsymbol_nodump (Lisp_Object *location, const char *name); + const Ascbyte *name); +MODULE_API void defsymbol (Lisp_Object *location, const Ascbyte *name); +MODULE_API void defsymbol_nodump (Lisp_Object *location, const Ascbyte *name); /* Defining symbols: @@ -370,18 +370,18 @@ #define DEFSYMBOL_MULTIWORD_PREDICATE_NO_DUMP(name) \ defsymbol_massage_multiword_predicate_nodump (&name, #name) -MODULE_API void defkeyword (Lisp_Object *location, const char *name); +MODULE_API void defkeyword (Lisp_Object *location, const Ascbyte *name); MODULE_API void defkeyword_massage_name (Lisp_Object *location, - const char *name); + const Ascbyte *name); #define DEFKEYWORD(name) defkeyword_massage_name (&name, #name) -MODULE_API void deferror (Lisp_Object *symbol, const char *name, - const char *message, Lisp_Object inherits_from); -MODULE_API void deferror_massage_name (Lisp_Object *symbol, const char *name, - const char *message, +MODULE_API void deferror (Lisp_Object *symbol, const Ascbyte *name, + const Ascbyte *message, Lisp_Object inherits_from); +MODULE_API void deferror_massage_name (Lisp_Object *symbol, const Ascbyte *name, + const Ascbyte *message, Lisp_Object inherits_from); MODULE_API void deferror_massage_name_and_message (Lisp_Object *symbol, - const char *name, + const Ascbyte *name, Lisp_Object inherits_from); #define DEFERROR(name, message, inherits_from) \ deferror_massage_name (&name, #name, message, inherits_from) @@ -393,7 +393,7 @@ /* Macros we use to define forwarded Lisp variables. These are used in the syms_of_FILENAME functions. */ -MODULE_API void defvar_magic (const char *symbol_name, +MODULE_API void defvar_magic (const Ascbyte *symbol_name, const struct symbol_value_forward *magic); #ifdef NEW_GC
--- a/src/sysdep.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/sysdep.c Tue Jan 26 23:22:30 2010 -0600 @@ -1,7 +1,7 @@ /* Interfaces to system-dependent kernel and library entries. Copyright (C) 1985-1988, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2010 Ben Wing. This file is part of XEmacs. @@ -2037,11 +2037,10 @@ #elif !defined (HAVE_GETHOSTNAME) struct utsname uts; uname (&uts); - Vsystem_name = build_string (uts.nodename); + Vsystem_name = build_ext_string (uts.nodename, Qunix_host_name_encoding); #else /* HAVE_GETHOSTNAME */ int hostname_size = 256; - /* !!#### Needs review */ - char *hostname = (char *) ALLOCA (hostname_size); + Extbyte *hostname = alloca_extbytes (hostname_size); /* Try to get the host name; if the buffer is too short, try again. Apparently, the only indication gethostname gives of @@ -2057,17 +2056,17 @@ break; hostname_size <<= 1; - /* !!#### Needs review */ - hostname = (char *) ALLOCA (hostname_size); + hostname = alloca_extbytes (hostname_size); } -# if defined( HAVE_SOCKETS) +# if defined (HAVE_SOCKETS) /* Turn the hostname into the official, fully-qualified hostname. Don't do this if we're going to dump; this can confuse system libraries on some machines and make the dumped emacs core dump. */ if (initialized) + /* !!#### Could fail if we have a 7-bit external encoding */ if (!strchr (hostname, '.')) { -# if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO)) +# if !(defined (HAVE_GETADDRINFO) && defined (HAVE_GETNAMEINFO)) struct hostent *hp = NULL; int count; # ifdef TRY_AGAIN @@ -2087,20 +2086,20 @@ # endif if (hp) { - const char *fqdn = (const char *) hp->h_name; - + const Extbyte *fqdn = (const Extbyte *) hp->h_name; + + /* !!#### Could fail if we have a 7-bit external encoding */ if (!strchr (fqdn, '.')) { /* We still don't have a fully qualified domain name. Try to find one in the list of alternate names */ - char **alias = hp->h_aliases; + Extbyte **alias = hp->h_aliases; while (*alias && !strchr (*alias, '.')) alias++; if (*alias) fqdn = *alias; } - /* !!#### Needs review */ - hostname = (char *) ALLOCA (strlen (fqdn) + 1); + hostname = alloca_extbytes (strlen (fqdn) + 1); strcpy (hostname, fqdn); } # else /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */ @@ -2117,8 +2116,7 @@ hints.ai_protocol = 0; if (!getaddrinfo (hostname, NULL, &hints, &res)) { - /* !!#### Needs review */ - hostname = (char *) ALLOCA (strlen (res->ai_canonname) + 1); + hostname = alloca_extbytes (strlen (res->ai_canonname) + 1); strcpy (hostname, res->ai_canonname); freeaddrinfo (res); @@ -2126,7 +2124,7 @@ # endif /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */ } # endif /* HAVE_SOCKETS */ - Vsystem_name = build_string (hostname); + Vsystem_name = build_ext_string (hostname, Qunix_host_name_encoding); #endif /* HAVE_GETHOSTNAME */ { Ibyte *p; @@ -3572,7 +3570,7 @@ #if defined(WIN32_NATIVE) || defined(CYGWIN) const char *sys_siglist[] = { - /* $$####begin-snarf */ + /* @@@begin-snarf@@@ */ "bum signal!!", "hangup", "interrupt", @@ -3598,8 +3596,8 @@ "background write attempted from control tty", "input record available at control tty", "exceeded CPU time limit", - "exceeded file size limit" - /* $$####end-snarf */ + "exceeded file size limit", + /* @@@end-snarf@@@ */ }; #endif @@ -3608,83 +3606,85 @@ const char *sys_siglist[NSIG + 1] = { /* AIX has changed the signals a bit */ - DEFER_GETTEXT ("bogus signal"), /* 0 */ - DEFER_GETTEXT ("hangup"), /* 1 SIGHUP */ - DEFER_GETTEXT ("interrupt"), /* 2 SIGINT */ - DEFER_GETTEXT ("quit"), /* 3 SIGQUIT */ - DEFER_GETTEXT ("illegal instruction"), /* 4 SIGILL */ - DEFER_GETTEXT ("trace trap"), /* 5 SIGTRAP */ - DEFER_GETTEXT ("IOT instruction"), /* 6 SIGIOT */ - DEFER_GETTEXT ("crash likely"), /* 7 SIGDANGER */ - DEFER_GETTEXT ("floating point exception"), /* 8 SIGFPE */ - DEFER_GETTEXT ("kill"), /* 9 SIGKILL */ - DEFER_GETTEXT ("bus error"), /* 10 SIGBUS */ - DEFER_GETTEXT ("segmentation violation"), /* 11 SIGSEGV */ - DEFER_GETTEXT ("bad argument to system call"), /* 12 SIGSYS */ - DEFER_GETTEXT ("write on a pipe with no one to read it"), /* 13 SIGPIPE */ - DEFER_GETTEXT ("alarm clock"), /* 14 SIGALRM */ - DEFER_GETTEXT ("software termination signal"), /* 15 SIGTERM */ - DEFER_GETTEXT ("user defined signal 1"), /* 16 SIGUSR1 */ - DEFER_GETTEXT ("user defined signal 2"), /* 17 SIGUSR2 */ - DEFER_GETTEXT ("death of a child"), /* 18 SIGCLD */ - DEFER_GETTEXT ("power-fail restart"), /* 19 SIGPWR */ - DEFER_GETTEXT ("bogus signal"), /* 20 */ - DEFER_GETTEXT ("bogus signal"), /* 21 */ - DEFER_GETTEXT ("bogus signal"), /* 22 */ - DEFER_GETTEXT ("bogus signal"), /* 23 */ - DEFER_GETTEXT ("bogus signal"), /* 24 */ - DEFER_GETTEXT ("LAN I/O interrupt"), /* 25 SIGAIO */ - DEFER_GETTEXT ("PTY I/O interrupt"), /* 26 SIGPTY */ - DEFER_GETTEXT ("I/O intervention required"), /* 27 SIGIOINT */ - /* $$####end-snarf */ + /* @@@begin-snarf@@@ */ + "bogus signal", /* 0 */ + "hangup", /* 1 SIGHUP */ + "interrupt", /* 2 SIGINT */ + "quit", /* 3 SIGQUIT */ + "illegal instruction", /* 4 SIGILL */ + "trace trap", /* 5 SIGTRAP */ + "IOT instruction", /* 6 SIGIOT */ + "crash likely", /* 7 SIGDANGER */ + "floating point exception", /* 8 SIGFPE */ + "kill", /* 9 SIGKILL */ + "bus error", /* 10 SIGBUS */ + "segmentation violation", /* 11 SIGSEGV */ + "bad argument to system call", /* 12 SIGSYS */ + "write on a pipe with no one to read it", /* 13 SIGPIPE */ + "alarm clock", /* 14 SIGALRM */ + "software termination signal", /* 15 SIGTERM */ + "user defined signal 1", /* 16 SIGUSR1 */ + "user defined signal 2", /* 17 SIGUSR2 */ + "death of a child", /* 18 SIGCLD */ + "power-fail restart", /* 19 SIGPWR */ + "bogus signal", /* 20 */ + "bogus signal", /* 21 */ + "bogus signal", /* 22 */ + "bogus signal", /* 23 */ + "bogus signal", /* 24 */ + "LAN I/O interrupt", /* 25 SIGAIO */ + "PTY I/O interrupt", /* 26 SIGPTY */ + "I/O intervention required", /* 27 SIGIOINT */ + /* @@@end-snarf@@@ */ 0 }; #else /* USG, not AIX */ const char *sys_siglist[NSIG + 1] = { - DEFER_GETTEXT ("bogus signal"), /* 0 */ - DEFER_GETTEXT ("hangup"), /* 1 SIGHUP */ - DEFER_GETTEXT ("interrupt"), /* 2 SIGINT */ - DEFER_GETTEXT ("quit"), /* 3 SIGQUIT */ - DEFER_GETTEXT ("illegal instruction"), /* 4 SIGILL */ - DEFER_GETTEXT ("trace trap"), /* 5 SIGTRAP */ - DEFER_GETTEXT ("IOT instruction"), /* 6 SIGIOT */ - DEFER_GETTEXT ("EMT instruction"), /* 7 SIGEMT */ - DEFER_GETTEXT ("floating point exception"), /* 8 SIGFPE */ - DEFER_GETTEXT ("kill"), /* 9 SIGKILL */ - DEFER_GETTEXT ("bus error"), /* 10 SIGBUS */ - DEFER_GETTEXT ("segmentation violation"), /* 11 SIGSEGV */ - DEFER_GETTEXT ("bad argument to system call"), /* 12 SIGSYS */ - DEFER_GETTEXT ("write on a pipe with no one to read it"), /* 13 SIGPIPE */ - DEFER_GETTEXT ("alarm clock"), /* 14 SIGALRM */ - DEFER_GETTEXT ("software termination signal"), /* 15 SIGTERM */ - DEFER_GETTEXT ("user defined signal 1"), /* 16 SIGUSR1 */ - DEFER_GETTEXT ("user defined signal 2"), /* 17 SIGUSR2 */ - DEFER_GETTEXT ("death of a child"), /* 18 SIGCLD */ - DEFER_GETTEXT ("power-fail restart"), /* 19 SIGPWR */ -#ifdef sun - "window size changed", /* 20 SIGWINCH */ - "urgent socket condition", /* 21 SIGURG */ - "pollable event occurred", /* 22 SIGPOLL */ - "stop (cannot be caught or ignored)", /* 23 SIGSTOP */ - "user stop requested from tty", /* 24 SIGTSTP */ - "stopped process has been continued", /* 25 SIGCONT */ - "background tty read attempted", /* 26 SIGTTIN */ - "background tty write attempted", /* 27 SIGTTOU */ - "virtual timer expired", /* 28 SIGVTALRM */ - "profiling timer expired", /* 29 SIGPROF */ - "exceeded cpu limit", /* 30 SIGXCPU */ - "exceeded file size limit", /* 31 SIGXFSZ */ - "process's lwps are blocked", /* 32 SIGWAITING */ - "special signal used by thread library", /* 33 SIGLWP */ + /* @@@begin-snarf@@@ */ + "bogus signal", /* 0 */ + "hangup", /* 1 SIGHUP */ + "interrupt", /* 2 SIGINT */ + "quit", /* 3 SIGQUIT */ + "illegal instruction", /* 4 SIGILL */ + "trace trap", /* 5 SIGTRAP */ + "IOT instruction", /* 6 SIGIOT */ + "EMT instruction", /* 7 SIGEMT */ + "floating point exception", /* 8 SIGFPE */ + "kill", /* 9 SIGKILL */ + "bus error", /* 10 SIGBUS */ + "segmentation violation", /* 11 SIGSEGV */ + "bad argument to system call", /* 12 SIGSYS */ + "write on a pipe with no one to read it", /* 13 SIGPIPE */ + "alarm clock", /* 14 SIGALRM */ + "software termination signal", /* 15 SIGTERM */ + "user defined signal 1", /* 16 SIGUSR1 */ + "user defined signal 2", /* 17 SIGUSR2 */ + "death of a child", /* 18 SIGCLD */ + "power-fail restart", /* 19 SIGPWR */ +#ifdef sun + "window size changed", /* 20 SIGWINCH */ + "urgent socket condition", /* 21 SIGURG */ + "pollable event occurred", /* 22 SIGPOLL */ + "stop (cannot be caught or ignored)", /* 23 SIGSTOP */ + "user stop requested from tty", /* 24 SIGTSTP */ + "stopped process has been continued", /* 25 SIGCONT */ + "background tty read attempted", /* 26 SIGTTIN */ + "background tty write attempted", /* 27 SIGTTOU */ + "virtual timer expired", /* 28 SIGVTALRM */ + "profiling timer expired", /* 29 SIGPROF */ + "exceeded cpu limit", /* 30 SIGXCPU */ + "exceeded file size limit", /* 31 SIGXFSZ */ + "process's lwps are blocked", /* 32 SIGWAITING */ + "special signal used by thread library", /* 33 SIGLWP */ #ifdef SIGFREEZE - "special signal used by CPR", /* 34 SIGFREEZE */ + "special signal used by CPR", /* 34 SIGFREEZE */ #endif #ifdef SIGTHAW - "special signal used by CPR", /* 35 SIGTHAW */ + "special signal used by CPR", /* 35 SIGTHAW */ #endif #endif /* sun */ - /* $$####end-snarf */ + /* @@@end-snarf@@@ */ 0 }; #endif /* not AIX */
--- a/src/sysdll.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/sysdll.c Tue Jan 26 23:22:30 2010 -0600 @@ -1,5 +1,7 @@ /* sysdll.c --- system dependent support for dynamic linked libraries Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 2010 Ben Wing. + Author: William Perry <wmperry@aventail.com> This file is part of XEmacs. @@ -19,6 +21,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* This file has been Mule-ized, Ben Wing, 1-26-10. */ + #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -29,9 +33,9 @@ #ifdef DLSYM_NEEDS_UNDERSCORE #define MAYBE_PREPEND_UNDERSCORE(n) do { \ - CIbyte *buf = alloca_array (CIbyte, strlen (n) + 2); \ + Ibyte *buf = alloca_array (Ibyte, qxestrlen (n) + 2); \ *buf = '_'; \ - strcpy (buf + 1, n); \ + qxestrcpy (buf + 1, n); \ n = buf; \ } while (0) #else @@ -85,17 +89,21 @@ } dll_func -dll_function (dll_handle h, const CIbyte *n) +dll_function (dll_handle h, const Ibyte *n) { + Extbyte *next; MAYBE_PREPEND_UNDERSCORE (n); - return (dll_func) dlsym ((void *) h, n); + C_STRING_TO_EXTERNAL (n, next, Qdll_function_name_encoding); + return (dll_func) dlsym ((void *) h, next); } dll_var -dll_variable (dll_handle h, const CIbyte *n) +dll_variable (dll_handle h, const Ibyte *n) { + Extbyte *next; MAYBE_PREPEND_UNDERSCORE (n); - return (dll_var)dlsym ((void *)h, n); + C_STRING_TO_EXTERNAL (n, next, Qdll_variable_name_encoding); + return (dll_var)dlsym ((void *)h, next); } Lisp_Object @@ -164,8 +172,7 @@ { /* #### WTF?! Shouldn't this at least attempt to get strerror or something? --hniksic */ - return build_string ("Generic shared library error", - Qerror_message_encoding); + return build_ascstring ("Generic shared library error"); } #elif defined (WIN32_NATIVE) || defined (CYGWIN) @@ -196,25 +203,27 @@ } dll_func -dll_function (dll_handle h, const CIbyte *n) +dll_function (dll_handle h, const Ibyte *n) { - return (dll_func) GetProcAddress ((HINSTANCE) h, n); + Extbyte *next = NEW_C_STRING_TO_EXTERNAL (n, Qmswindows_multibyte); + return (dll_func) GetProcAddress ((HINSTANCE) h, next); } dll_func -dll_variable (dll_handle h, const CIbyte *n) +dll_variable (dll_handle h, const Ibyte *n) { - return (dll_func) GetProcAddress ((HINSTANCE) h, n); + Extbyte *next = NEW_C_STRING_TO_EXTERNAL (n, Qmswindows_multibyte); + return (dll_func) GetProcAddress ((HINSTANCE) h, next); } Lisp_Object dll_error () { - CIbyte err[32]; + Ascbyte err[32]; snprintf (err, 32, "Windows DLL Error %lu", GetLastError ()); - return build_string (err); + return build_ascstring (err); } -#elif defined(HAVE_DYLD) +#elif defined (HAVE_DYLD) /* This section supports MacOSX dynamic libraries. Dynamically loadable libraries must be compiled as bundles, not dynamiclibs. */ @@ -243,21 +252,20 @@ { LISP_STRING_TO_EXTERNAL (fname, soname, Qdll_filename_encoding); } - ret = NSCreateObjectFileImageFromFile(soname, &file); - if (ret != NSObjectFileImageSuccess) { + ret = NSCreateObjectFileImageFromFile (soname, &file); + if (ret != NSObjectFileImageSuccess) return NULL; - } - out = NSLinkModule(file, soname, - NSLINKMODULE_OPTION_BINDNOW | - NSLINKMODULE_OPTION_PRIVATE | - NSLINKMODULE_OPTION_RETURN_ON_ERROR); - return (dll_handle)out; + out = NSLinkModule (file, soname, + NSLINKMODULE_OPTION_BINDNOW | + NSLINKMODULE_OPTION_PRIVATE | + NSLINKMODULE_OPTION_RETURN_ON_ERROR); + return (dll_handle) out; } int dll_close (dll_handle h) { - return NSUnLinkModule((NSModule)h, NSUNLINKMODULE_OPTION_NONE); + return NSUnLinkModule ((NSModule) h, NSUNLINKMODULE_OPTION_NONE); } /* Given an address, return the mach_header for the image containing it @@ -268,27 +276,28 @@ * (http://www.opendarwin.org/projects/dlcompat). */ -static const struct mach_header* -image_for_address(void *address) +static const struct mach_header * +image_for_address (void *address) { unsigned long i; - unsigned long count = _dyld_image_count(); + unsigned long count = _dyld_image_count (); const struct mach_header *mh = 0; for (i = 0; i < count; i++) { - unsigned long addr = (unsigned long)address - - _dyld_get_image_vmaddr_slide(i); - mh = _dyld_get_image_header(i); + unsigned long addr = (unsigned long) address - + _dyld_get_image_vmaddr_slide (i); + mh = _dyld_get_image_header (i); if (mh) { struct load_command *lc = - (struct load_command *)((char *)mh + sizeof(struct mach_header)); + (struct load_command *) ((Rawbyte *) mh + + sizeof(struct mach_header)); unsigned long j; for (j = 0; j < mh->ncmds; - j++, lc = (struct load_command *)((char *)lc + lc->cmdsize)) + j++, lc = (struct load_command *) ((Rawbyte *)lc + lc->cmdsize)) { if (LC_SEGMENT == lc->cmd && addr >= ((struct segment_command *)lc)->vmaddr && @@ -308,25 +317,25 @@ return mh; } -static const struct mach_header* -my_find_image(const char *name) +static const struct mach_header * +my_find_image (const char *name) { const struct mach_header *mh = (struct mach_header *) - NSAddImage(name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | - NSADDIMAGE_OPTION_RETURN_ON_ERROR); + NSAddImage (name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | + NSADDIMAGE_OPTION_RETURN_ON_ERROR); if (!mh) { - int count = _dyld_image_count(); + int count = _dyld_image_count (); int j; for (j = 0; j < count; j++) { - const char *id = _dyld_get_image_name(j); + const char *id = _dyld_get_image_name (j); - if (!strcmp(id, name)) + if (!strcmp (id, name)) { - mh = _dyld_get_image_header(j); + mh = _dyld_get_image_header (j); break; } } @@ -343,32 +352,36 @@ * dependencies, then it probably isn't there. */ static NSSymbol -search_linked_libs(const struct mach_header * mh, const char *symbol) +search_linked_libs (const struct mach_header * mh, const Ibyte *symbol) { unsigned long n; NSSymbol nssym = 0; struct load_command *lc = - (struct load_command *)((char *)mh + sizeof(struct mach_header)); + (struct load_command *) ((Rawbyte *) mh + sizeof (struct mach_header)); for (n = 0; n < mh->ncmds; - n++, lc = (struct load_command *)((char *)lc + lc->cmdsize)) + n++, lc = (struct load_command *) ((Rawbyte *) lc + lc->cmdsize)) { if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) { struct mach_header *wh; if ((wh = (struct mach_header *) - my_find_image((char *)(((struct dylib_command *)lc)->dylib.name.offset + - (char *)lc)))) + my_find_image((Rawbyte *) + (((struct dylib_command *) lc)-> + dylib.name.offset + (Rawbyte *) lc)))) { - if (NSIsSymbolNameDefinedInImage(wh, symbol)) + Extbyte *symext = + NEW_C_STRING_TO_EXTERNAL (symbol, Qdll_symbol_encoding); + if (NSIsSymbolNameDefinedInImage (wh, symext)) { nssym = - NSLookupSymbolInImage(wh, - symbol, - NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | - NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + NSLookupSymbolInImage + (wh, + symext, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); break; } } @@ -379,10 +392,13 @@ } dll_func -dll_function (dll_handle h, const CIbyte *n) +dll_function (dll_handle h, const Ibyte *n) { NSSymbol sym = 0; + Extbyte *next; + MAYBE_PREPEND_UNDERSCORE (n); + C_STRING_TO_EXTERNAL (n, next, Qdll_function_name_encoding); /* NULL means the program image and shared libraries, not bundles. */ @@ -390,48 +406,54 @@ { /* NOTE: This assumes that this function is included in the main program and not in a shared library. */ - const struct mach_header* my_mh = image_for_address((void*) &dll_function); + const struct mach_header* my_mh = + image_for_address ((void*) &dll_function); - if (NSIsSymbolNameDefinedInImage(my_mh, n)) + if (NSIsSymbolNameDefinedInImage (my_mh, next)) { sym = - NSLookupSymbolInImage(my_mh, - n, - NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | - NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + NSLookupSymbolInImage + (my_mh, + next, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); } if (!sym) { - sym = search_linked_libs(my_mh, n); + sym = search_linked_libs (my_mh, n); } } else { - sym = NSLookupSymbolInModule((NSModule)h, n); + sym = NSLookupSymbolInModule ((NSModule)h, next); } if (sym == 0) return 0; - return (dll_func)NSAddressOfSymbol(sym); + return (dll_func) NSAddressOfSymbol (sym); } dll_var -dll_variable (dll_handle h, const CIbyte *n) +dll_variable (dll_handle h, const Ibyte *n) { NSSymbol sym; + Extbyte *next; + MAYBE_PREPEND_UNDERSCORE (n); - sym = NSLookupSymbolInModule((NSModule)h, n); + C_STRING_TO_EXTERNAL (n, next, Qdll_variable_name_encoding); + + sym = NSLookupSymbolInModule ((NSModule) h, n); if (sym == 0) return 0; - return (dll_var)NSAddressOfSymbol(sym); + return (dll_var) NSAddressOfSymbol (sym); } Lisp_Object -dll_error () +dll_error (void) { NSLinkEditErrors c; int errorNumber; - const CIbyte *fileNameWithError, *errorString; - NSLinkEditError(&c, &errorNumber, &fileNameWithError, &errorString); + const Extbyte *fileNameWithError, *errorString; + NSLinkEditError (&c, &errorNumber, &fileNameWithError, &errorString); return build_ext_string (errorString, Qerror_message_encoding); } #elif HAVE_LTDL @@ -461,21 +483,25 @@ } dll_func -dll_function (dll_handle h, const CIbyte *n) +dll_function (dll_handle h, const Ibyte *n) { + Extbyte *next; MAYBE_PREPEND_UNDERSCORE (n); - return (dll_func) lt_dlsym ((lt_dlhandle) h, n); + C_STRING_TO_EXTERNAL (n, next, Qdll_function_name_encoding); + return (dll_func) lt_dlsym ((lt_dlhandle) h, next); } dll_var -dll_variable (dll_handle h, const CIbyte *n) +dll_variable (dll_handle h, const Ibyte *n) { + Extbyte *next; MAYBE_PREPEND_UNDERSCORE (n); - return (dll_var) lt_dlsym ((lt_dlhandle) h, n); + C_STRING_TO_EXTERNAL (n, next, Qdll_variable_name_encoding); + return (dll_var) lt_dlsym ((lt_dlhandle) h, next); } Lisp_Object -dll_error () +dll_error (void) { return build_ext_string (lt_dlerror (), Qerror_message_encoding); } @@ -494,21 +520,21 @@ } dll_func -dll_function (dll_handle h, const CIbyte *n) +dll_function (dll_handle h, const Ibyte *n) { return NULL; } dll_func -dll_variable (dll_handle h, const CIbyte *n) +dll_variable (dll_handle h, const Ibyte *n) { return NULL; } Lisp_Object -dll_error () +dll_error (void) { - return build_string ("Shared libraries not implemented on this system"); + return build_ascstring ("Shared libraries not implemented on this system"); } #endif /* System conditionals */
--- a/src/sysdll.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/sysdll.h Tue Jan 26 23:22:30 2010 -0600 @@ -19,6 +19,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* This file has been Mule-ized, Ben Wing, 1-26-10. */ + #ifndef INCLUDED_sysdll_h_ #define INCLUDED_sysdll_h_ @@ -30,15 +32,10 @@ extern dll_handle dll_open (Lisp_Object); extern int dll_close (dll_handle); -extern dll_func dll_function (dll_handle, const CIbyte *); -extern dll_var dll_variable (dll_handle, const CIbyte *); +extern dll_func dll_function (dll_handle, const Ibyte *); +extern dll_var dll_variable (dll_handle, const Ibyte *); extern Lisp_Object dll_error (void); -/* More stand-ins ... */ - -#define Qdll_filename_encoding Qfile_name -#define Qdll_function_name_encoding Qnative - END_C_DECLS #endif /* INCLUDED_sysdll_h_ */
--- a/src/sysfile.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/sysfile.h Tue Jan 26 23:22:30 2010 -0600 @@ -497,7 +497,7 @@ } #define DIRECTORY_SEP sysfile_get_directory_sep() -#define DEFAULT_DIRECTORY_FALLBACK ((const CIbyte *)"C:\\") +#define DEFAULT_DIRECTORY_FALLBACK "C:\\" #else /* not emacs */ @@ -511,7 +511,7 @@ #define SEPCHAR ':' #define DEFAULT_DIRECTORY_SEP '/' #define DIRECTORY_SEP '/' -#define DEFAULT_DIRECTORY_FALLBACK ((const CIbyte *)"/") +#define DEFAULT_DIRECTORY_FALLBACK "/" #endif /* WIN32_NATIVE */
--- a/src/syswindows.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/syswindows.h Tue Jan 26 23:22:30 2010 -0600 @@ -1239,7 +1239,7 @@ /* in win32.c */ Extbyte *mswindows_get_module_file_name (void); void mswindows_output_last_error (const Ascbyte *frob); -DECLARE_DOESNT_RETURN (mswindows_report_process_error (const char *string, +DECLARE_DOESNT_RETURN (mswindows_report_process_error (const Ascbyte *reason, Lisp_Object data, int errnum)); Lisp_Object mswindows_lisp_error (int errnum);
--- a/src/tests.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/tests.c Tue Jan 26 23:22:30 2010 -0600 @@ -148,14 +148,14 @@ #define DFC_CHECK_LENGTH(len1,len2,str1) \ else if ((len1) != (len2)) \ conversion_result = \ - Fcons (list3 (build_string(str1), Qnil, build_string("wrong length")), \ + Fcons (list3 (build_string(str1), Qnil, build_ascstring("wrong length")), \ conversion_result) #define DFC_CHECK_CONTENT(str1,str2,len1,str3) \ else if (memcmp (str1, str2, len1)) \ conversion_result = \ Fcons (list3 (build_string(str3), Qnil, \ - build_string("octet comparison failed")), \ + build_ascstring("octet comparison failed")), \ conversion_result) #define DFC_RESULT_PASS(str1) \ @@ -607,17 +607,17 @@ data.sum = 0; elisp_maphash_unsafe (test_hash_tables_mapper, data.hash_table, (void *) &data); - hash_result = Fcons (list3 (build_string ("simple mapper"), + hash_result = Fcons (list3 (build_ascstring ("simple mapper"), (data.sum == 2 + 4) ? Qt : Qnil, - build_string ("sum != 2 + 4")), + build_ascstring ("sum != 2 + 4")), hash_result); data.sum = 0; elisp_maphash (test_hash_tables_modifying_mapper, data.hash_table, (void *) &data); - hash_result = Fcons (list3 (build_string ("modifying mapper"), + hash_result = Fcons (list3 (build_ascstring ("modifying mapper"), (data.sum == 2 + 4) ? Qt : Qnil, - build_string ("sum != 2 + 4")), + build_ascstring ("sum != 2 + 4")), hash_result); /* hash table now contains: (1, 2) (3, 4) (-1, 2*2) (-3, 2*4) */ @@ -625,9 +625,9 @@ data.sum = 0; elisp_maphash_unsafe (test_hash_tables_mapper, data.hash_table, (void *) &data); - hash_result = Fcons (list3 (build_string ("simple mapper"), + hash_result = Fcons (list3 (build_ascstring ("simple mapper"), (data.sum == 3 * (2 + 4)) ? Qt : Qnil, - build_string ("sum != 3 * (2 + 4)")), + build_ascstring ("sum != 3 * (2 + 4)")), hash_result); /* Remove entries with negative keys, added by modifying mapper */ @@ -637,9 +637,9 @@ data.sum = 0; elisp_maphash_unsafe (test_hash_tables_mapper, data.hash_table, (void *) &data); - hash_result = Fcons (list3 (build_string ("remove negatives mapper"), + hash_result = Fcons (list3 (build_ascstring ("remove negatives mapper"), (data.sum == 2 + 4) ? Qt : Qnil, - build_string ("sum != 2 + 4")), + build_ascstring ("sum != 2 + 4")), hash_result); return hash_result;
--- a/src/text.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/text.c Tue Jan 26 23:22:30 2010 -0600 @@ -5158,10 +5158,10 @@ void vars_of_text (void) { - QSin_char_byte_conversion = build_msg_string ("(in char-byte conversion)"); + QSin_char_byte_conversion = build_defer_string ("(in char-byte conversion)"); staticpro (&QSin_char_byte_conversion); QSin_internal_external_conversion = - build_msg_string ("(in internal-external conversion)"); + build_defer_string ("(in internal-external conversion)"); staticpro (&QSin_internal_external_conversion); #ifdef ENABLE_COMPOSITE_CHARS
--- a/src/text.h Tue Jan 26 22:48:23 2010 -0600 +++ b/src/text.h Tue Jan 26 23:22:30 2010 -0600 @@ -1,7 +1,7 @@ /* Header file for text manipulation primitives and macros. Copyright (C) 1985-1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2010 Ben Wing. This file is part of XEmacs. @@ -538,6 +538,17 @@ #endif /* MULE */ +/* ASSERT_ASCTEXT_ASCII(ptr): Check that an Ascbyte * pointer points to + purely ASCII text. Useful for checking that putatively ASCII strings + (i.e. declared as Ascbyte * or const Ascbyte *) are actually ASCII. + This is important because otherwise we need to worry about what + encoding they are in -- internal or some external encoding. + + ASSERT_ASCTEXT_ASCII_LEN(ptr, len): Same as ASSERT_ASCTEXT_ASCII() + but where the length has been explicitly given. Useful if the string + may contain embedded zeroes. +*/ + #ifdef ERROR_CHECK_TEXT #define ASSERT_ASCTEXT_ASCII_LEN(ptr, len) \ do { \ @@ -2957,26 +2968,6 @@ (Extbyte *) new_dfc_convert_malloc (LISP_TO_VOID (src), -1, \ DFC_LISP_STRING, codesys) -/* Standins for various encodings. */ -#ifdef WEXTTEXT_IS_WIDE -#define Qcommand_argument_encoding Qmswindows_unicode -#define Qenvironment_variable_encoding Qmswindows_unicode -#else -#define Qcommand_argument_encoding Qnative -#define Qenvironment_variable_encoding Qnative -#endif -#define Qunix_host_name_encoding Qnative -#define Qunix_service_name_encoding Qnative -#define Qtime_function_encoding Qnative -#define Qtime_zone_encoding Qtime_function_encoding -#define Qmswindows_host_name_encoding Qmswindows_multibyte -#define Qmswindows_service_name_encoding Qmswindows_multibyte -#define Quser_name_encoding Qnative -#define Qerror_message_encoding Qnative -#define Qjpeg_error_message_encoding Qerror_message_encoding -#define Qtooltalk_encoding Qnative -#define Qgtk_encoding Qnative - /* Wexttext functions. The type of Wexttext is selected at compile time and will sometimes be wchar_t, sometimes char. */ @@ -3033,7 +3024,7 @@ #define WEXTTEXT_TO_8_BIT(arg) ((Extbyte *) arg) #endif -/* Standins for various X encodings. +/* Standins for various encodings. About encodings in X: @@ -3089,6 +3080,31 @@ COMPOUND_TEXT otherwise. */ +#ifdef WEXTTEXT_IS_WIDE +#define Qcommand_argument_encoding Qmswindows_unicode +#define Qenvironment_variable_encoding Qmswindows_unicode +#else +#define Qcommand_argument_encoding Qnative +#define Qenvironment_variable_encoding Qnative +#endif +#define Qunix_host_name_encoding Qnative +#define Qunix_service_name_encoding Qnative +#define Qtime_function_encoding Qnative +#define Qtime_zone_encoding Qtime_function_encoding +#define Qmswindows_host_name_encoding Qmswindows_multibyte +#define Qmswindows_service_name_encoding Qmswindows_multibyte +#define Quser_name_encoding Qnative +#define Qerror_message_encoding Qnative +#define Qjpeg_error_message_encoding Qerror_message_encoding +#define Qtooltalk_encoding Qnative +#define Qgtk_encoding Qnative + +#define Qdll_symbol_encoding Qnative +#define Qdll_function_name_encoding Qdll_symbol_encoding +#define Qdll_variable_name_encoding Qdll_symbol_encoding +#define Qdll_filename_encoding Qfile_name +#define Qemodule_string_encoding Qnative + /* !!#### Need to verify the encoding used in lwlib -- Qnative or Qctext? Almost certainly the former. Use a standin for now. */ #define Qlwlib_encoding Qnative
--- a/src/tooltalk.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/tooltalk.c Tue Jan 26 23:22:30 2010 -0600 @@ -520,21 +520,21 @@ static Lisp_Object tt_opnum_string (int n) { - char buf[32]; + Ascbyte buf[32]; sprintf (buf, "%u", n); - return build_string (buf); + return build_ascstring (buf); } static Lisp_Object tt_message_arg_ival_string (Tt_message m, int n) { - char buf[DECIMAL_PRINT_SIZE (long)]; + Ascbyte buf[DECIMAL_PRINT_SIZE (long)]; int value; check_status (tt_message_arg_ival (m, n, &value)); long_to_string (buf, value); - return build_string (buf); + return build_ascstring (buf); } static Lisp_Object @@ -1215,8 +1215,8 @@ */ ()) { - char *procid = tt_default_procid (); - return procid ? build_string (procid) : Qnil; + Extbyte *procid = tt_default_procid (); + return procid ? build_ext_string (procid, Qtooltalk_encoding) : Qnil; } DEFUN ("tooltalk-default-session", Ftooltalk_default_session, 0, 0, 0, /* @@ -1224,8 +1224,8 @@ */ ()) { - char *session = tt_default_session (); - return session ? build_string (session) : Qnil; + Extbyte *session = tt_default_session (); + return session ? build_ext_string (session, Qtooltalk_encoding) : Qnil; } static void @@ -1265,7 +1265,7 @@ tt_session_join (tt_default_session ()); - lp = connect_to_file_descriptor (build_string ("tooltalk"), Qnil, + lp = connect_to_file_descriptor (build_ascstring ("tooltalk"), Qnil, Vtooltalk_fd, Vtooltalk_fd); if (!NILP (lp)) { @@ -1421,8 +1421,8 @@ */ ); Vtooltalk_unprocessed_message_hook = Qnil; - Tooltalk_Message_plist_str = build_msg_string ("Tooltalk Message plist"); - Tooltalk_Pattern_plist_str = build_msg_string ("Tooltalk Pattern plist"); + Tooltalk_Message_plist_str = build_defer_string ("Tooltalk Message plist"); + Tooltalk_Pattern_plist_str = build_defer_string ("Tooltalk Pattern plist"); staticpro(&Tooltalk_Message_plist_str); staticpro(&Tooltalk_Pattern_plist_str);
--- a/src/ui-gtk.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/ui-gtk.c Tue Jan 26 23:22:30 2010 -0600 @@ -94,7 +94,7 @@ /* If the dll name has a directory component in it, then we should expand it. */ - if (!NILP (Fstring_match (build_string ("/"), dll, Qnil, Qnil))) + if (!NILP (Fstring_match (build_ascstring ("/"), dll, Qnil, Qnil))) dll = Fexpand_file_name (dll, Qnil); /* Check if we have already opened it first */ @@ -463,43 +463,43 @@ switch (GTK_FUNDAMENTAL_TYPE (t)) { case GTK_TYPE_NONE: - return (build_string ("NONE")); + return (build_ascstring ("NONE")); /* flag types */ case GTK_TYPE_CHAR: case GTK_TYPE_UCHAR: - return (build_string ("CHAR")); + return (build_ascstring ("CHAR")); case GTK_TYPE_BOOL: - return (build_string ("BOOL")); + return (build_ascstring ("BOOL")); case GTK_TYPE_ENUM: case GTK_TYPE_FLAGS: case GTK_TYPE_INT: case GTK_TYPE_UINT: - return (build_string ("INT")); + return (build_ascstring ("INT")); case GTK_TYPE_LONG: case GTK_TYPE_ULONG: - return (build_string ("LONG")); + return (build_ascstring ("LONG")); case GTK_TYPE_FLOAT: case GTK_TYPE_DOUBLE: - return (build_string ("FLOAT")); + return (build_ascstring ("FLOAT")); case GTK_TYPE_STRING: - return (build_string ("STRING")); + return (build_ascstring ("STRING")); case GTK_TYPE_BOXED: case GTK_TYPE_POINTER: - return (build_string ("POINTER")); + return (build_ascstring ("POINTER")); case GTK_TYPE_OBJECT: - return (build_string ("OBJECT")); + return (build_ascstring ("OBJECT")); case GTK_TYPE_CALLBACK: - return (build_string ("CALLBACK")); + return (build_ascstring ("CALLBACK")); default: /* I can't put this in the main switch statement because it is a new fundamental type that is not fixed at compile time. *sigh* */ if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_ARRAY)) - return (build_string ("ARRAY")); + return (build_ascstring ("ARRAY")); if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_LISTOF)) - return (build_string ("LIST")); + return (build_ascstring ("LIST")); return (Qnil); } } @@ -643,13 +643,13 @@ { invalid_argument ("Do not know how to marshal", type); } - marshaller = concat3 (marshaller, build_string ("_"), marshaller_type); + marshaller = concat3 (marshaller, build_ascstring ("_"), marshaller_type); n_args++; } } else { - marshaller = concat3 (marshaller, build_string ("_"), type_to_marshaller_type (GTK_TYPE_NONE)); + marshaller = concat3 (marshaller, build_ascstring ("_"), type_to_marshaller_type (GTK_TYPE_NONE)); } rettype = Fsymbol_name (rettype); @@ -662,8 +662,8 @@ import_gtk_type (data->return_type); - marshaller = concat3 (type_to_marshaller_type (data->return_type), build_string ("_"), marshaller); - marshaller = concat2 (build_string ("emacs_gtk_marshal_"), marshaller); + marshaller = concat3 (type_to_marshaller_type (data->return_type), build_ascstring ("_"), marshaller); + marshaller = concat2 (build_ascstring ("emacs_gtk_marshal_"), marshaller); marshaller_func = (ffi_marshalling_function) find_marshaller ((char *) XSTRING_DATA (marshaller)); @@ -798,11 +798,11 @@ if (print_readably) printing_unreadable_lcrecord (obj, 0); - write_c_string (printcharfun, "#<GtkObject ("); + write_ascstring (printcharfun, "#<GtkObject ("); if (XGTK_OBJECT (obj)->alive_p) write_c_string (printcharfun, gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object))); else - write_c_string (printcharfun, "dead"); + write_ascstring (printcharfun, "dead"); write_fmt_string (printcharfun, ") %p>", (void *) XGTK_OBJECT (obj)->object); } @@ -1117,7 +1117,7 @@ if (print_readably) printing_unreadable_lcrecord (obj, 0); - write_c_string (printcharfun, "#<GtkBoxed ("); + write_ascstring (printcharfun, "#<GtkBoxed ("); write_c_string (printcharfun, gtk_type_name (XGTK_BOXED (obj)->object_type)); write_fmt_string (printcharfun, ") %p>", (void *) XGTK_BOXED (obj)->object); }
--- a/src/unicode.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/unicode.c Tue Jan 26 23:22:30 2010 -0600 @@ -1155,7 +1155,7 @@ qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets); Vcurrent_jit_charset = Fmake_charset - (intern((const CIbyte *)setname), Vcharset_descr, + (intern_int (setname), Vcharset_descr, /* Set encode-as-utf-8 to t, to have this character set written using UTF-8 escapes in escape-quoted and ctext. This sidesteps the fact that our internal character -> Unicode @@ -2826,10 +2826,10 @@ write_fmt_string_lisp (printcharfun, "(%s", 1, unicode_getprop (cs, Qunicode_type)); if (XCODING_SYSTEM_UNICODE_LITTLE_ENDIAN (cs)) - write_c_string (printcharfun, ", little-endian"); + write_ascstring (printcharfun, ", little-endian"); if (XCODING_SYSTEM_UNICODE_NEED_BOM (cs)) - write_c_string (printcharfun, ", need-bom"); - write_c_string (printcharfun, ")"); + write_ascstring (printcharfun, ", need-bom"); + write_ascstring (printcharfun, ")"); } #ifdef MULE @@ -3048,18 +3048,12 @@ if (flags & QUERY_METHOD_ERRORP) { - DECLARE_EISTRING (error_details); - - eicpy_ascii (error_details, "Cannot encode "); - eicat_lstr (error_details, - make_string_from_buffer (buf, fail_range_start, - pos - - fail_range_start)); - eicat_ascii (error_details, " using coding system"); - - signal_error (Qtext_conversion_error, - (const CIbyte *)(eidata (error_details)), - XCODING_SYSTEM_NAME (codesys)); + signal_error_2 + (Qtext_conversion_error, + "Cannot encode using coding system", + make_string_from_buffer (buf, fail_range_start, + pos - fail_range_start), + XCODING_SYSTEM_NAME (codesys)); } if (NILP (result)) @@ -3219,7 +3213,7 @@ Vlast_jit_charset_final = make_char (0x30); staticpro (&Vcharset_descr); Vcharset_descr - = build_string ("Mule charset for otherwise unknown Unicode code points."); + = build_defer_string ("Mule charset for otherwise unknown Unicode code points."); staticpro (&Vlanguage_unicode_precedence_list); Vlanguage_unicode_precedence_list = Qnil; @@ -3268,7 +3262,7 @@ found (that is, they're probably Mule-specific charsets like Ethiopic or IPA.) */ ); - Qunicode_registries = vector1(build_string("iso10646-1")); + Qunicode_registries = vector1(build_ascstring("iso10646-1")); /* Initialised in lisp/mule/general-late.el, by a call to #'set-unicode-query-skip-chars-args. Or at least they would be, but we @@ -3298,9 +3292,9 @@ Cygwin 1.7 -- used in LOCAL_FILE_FORMAT_TO_TSTR() et al. */ Fmake_coding_system_internal (Qutf_8, Qunicode, - build_msg_string ("UTF-8"), + build_defer_string ("UTF-8"), nconc2 (list4 (Qdocumentation, - build_msg_string ( + build_defer_string ( "UTF-8 Unicode encoding -- ASCII-compatible 8-bit variable-width encoding\n" "sharing the following principles with the Mule-internal encoding:\n" "\n" @@ -3322,6 +3316,6 @@ " -- Given only the leading byte, you know how many following bytes\n" " are present.\n" ), - Qmnemonic, build_string ("UTF8")), + Qmnemonic, build_ascstring ("UTF8")), list2 (Qunicode_type, Qutf_8))); }
--- a/src/win32.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/win32.c Tue Jan 26 23:22:30 2010 -0600 @@ -299,11 +299,11 @@ } DOESNT_RETURN -mswindows_report_process_error (const char *string, Lisp_Object data, +mswindows_report_process_error (const Ascbyte *reason, Lisp_Object data, int errnum) { report_file_type_error (Qprocess_error, mswindows_lisp_error (errnum), - string, data); + reason, data); } DEFUN ("mswindows-shell-execute", Fmswindows_shell_execute, 2, 4, 0, /*
--- a/src/window.c Tue Jan 26 22:48:23 2010 -0600 +++ b/src/window.c Tue Jan 26 23:22:30 2010 -0600 @@ -318,10 +318,10 @@ if (print_readably) printing_unreadable_lcrecord (obj, 0); - write_c_string (printcharfun, "#<window"); + write_ascstring (printcharfun, "#<window"); buf = XWINDOW_BUFFER (obj); if (EQ (buf, Qt)) - write_c_string (printcharfun, " during creation"); + write_ascstring (printcharfun, " during creation"); else if (!NILP (buf)) {
--- a/src/xemacs.def.in.in Tue Jan 26 22:48:23 2010 -0600 +++ b/src/xemacs.def.in.in Tue Jan 26 23:22:30 2010 -0600 @@ -1,5 +1,6 @@ /* The module API: core symbols that are visible to modules. Copyright (C) 2008 Jerry James + Copyright (C) 2010 Ben Wing. This file is part of XEmacs. @@ -22,8 +23,14 @@ meant to be used directly, but a macro or inline function in the API expands to a form containing the symbol, then the macro or inline function is named in a comment to the right. */ + #define NOT_C_CODE #include <config.h> + +#if defined (ERROR_CHECK_TYPES) && defined (XEMACS_DEFS_NEEDS_INLINE_DECLS) +#define XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS +#endif + NAME xemacs.exe EXPORTS /* Exported functions */ @@ -45,9 +52,11 @@ #endif build_ext_string build_intstring -build_msg_intstring -build_msg_string build_string +build_ascstring +build_msg_istring +build_msg_cistring +build_msg_ascstring #ifdef MULE bytecount_to_charcount_fun /* bytecount_to_charcount */ #endif @@ -65,6 +74,8 @@ #endif check_quit /* QUITP */ check_what_happened /* QUIT */ +concat2 +concat3 cons3 copy_lisp_object dead_wrong_type_argument /* CHECK_xxx */ @@ -102,7 +113,7 @@ #ifdef DEBUG_XEMACS eq_with_ebola_notice /* EQ_WITH_EBOLA_NOTICE */ #endif -#ifdef NEED_ERROR_CHECK_TYPES_INLINES +#ifdef XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS error_check_cons #ifdef HAVE_LDAP error_check_ldap @@ -117,7 +128,7 @@ error_check_string_direct_data error_check_string_indirect_data #endif -#endif /* NEED_ERROR_CHECK_TYPES_INLINES */ +#endif /* XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS */ free_opaque_ptr get_coding_system_for_text_file intern @@ -139,6 +150,7 @@ make_vector maybe_invalid_operation message +nconc2 new_dfc_convert_copy_data /* C_STRING_TO_EXTERNAL, ... */ new_dfc_convert_malloc /* C_STRING_TO_EXTERNAL_MALLOC, ... */ new_dfc_convert_size /* C_STRING_TO_EXTERNAL, ... */ @@ -150,6 +162,38 @@ #endif out_of_memory /* The postgresql module uses this */ printing_unreadable_object +#ifdef XEMACS_DEFS_NEEDS_INLINE_DECLS +qxestrdup +qxestrlen +qxestrcharlen +qxestrcmp +qxestrcmp_ascii +qxestrncmp +qxestrncmp_ascii +qxestrcpy +qxestrcpy_ascii +qxestrncpy +qxestrncpy_ascii +qxestrcat +qxestrcat_ascii +qxestrncat +qxestrncat_ascii +qxestrchr +qxestrrchr +qxestrstr +qxestrcspn +qxestrspn +qxestrpbrk +qxestrtok +qxestrtod +qxestrtol +qxestrtoul +qxeatoi +qxestrupr +qxestrlwr +qxesprintf +qxesscanf_ascii_1 +#endif /* XEMACS_DEFS_NEEDS_INLINE_DECLS */ record_unwind_protect record_unwind_protect_freeing report_process_error @@ -175,17 +219,20 @@ #else unstaticpro_nodump_1 #endif +vconcat2 +vconcat3 vector1 vector2 vector3 warn_when_safe -#ifdef NEED_ERROR_CHECK_TYPES_INLINES +#ifdef XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS wrap_record_1 #endif write_c_string write_fmt_string write_fmt_string_lisp -write_string +write_istring +write_ascstring wrong_type_argument /* CONCHECK_xxx */ xemacs_c_alloca /* ALLOCA */ xfree_1 /* xfree */ @@ -225,7 +272,7 @@ Fsignal Fthrow Fvector -#ifdef NEED_ERROR_CHECK_TYPES_INLINES +#ifdef XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS XINT_1 #endif