From b7f3516f99450ec2f0338ed1d17e28491c85de9e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 15 Oct 1997 17:18:32 +0000 Subject: [PATCH] * Makefile.in: Rebuilt. * Makefile.am (libguile_la_SOURCES): Removed extchrs.c, mbstrings.c. (modinclude_HEADERS): Removed extchrs.h, mbstrings.h. * unif.c (scm_vector_set_length_x): Don't handle multibyte strings. * tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed. (scm_tag): Don't handle multibyte strings. * read.c: Don't include mbstrings.h. (scm_lreadr): Don't handle multibyte ports. * kw.c: Don't include mbstrings.h. * init.c: Don't include mbstrings.h. (scm_boot_guile_1): Don't init mbstrings module. * hash.c (scm_hasher): Don't handle mbstrings. * gscm.c (gscm_run_scm): Don't init mbstrings module. * gc.c (scm_gc_mark): Don't handle mbstrings. (scm_gc_sweep): Likewise. * eval.c (SCM_CEVAL): Don't handle mbstrings. * eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD. * tags.h (SCM_TYP7SD): Removed. (SCM_TYP7D): Removed. (scm_tc7_mb_string): Removed. (scm_tc7_mb_substring): Removed. * print.c (scm_iprin1): Handle char printing directly. Don't handle mbstrings. Don't include "mbstrings.h". * symbols.c (scm_intern_obarray_soft, scm_string_to_symbol, scm_string_to_obarray_symbol, msymbolize): Don't set symbol's multi-byte flag. Don't include "mbstrings.h". * symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed. (SCM_SYMBOL_SLOTS): Define as 4. (SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD. * arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c, gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c, print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c, struct.c, threads.c, throw.c, unif.c, variable.c: Use new ("gen"-less) I/O function names. * ports.c (scm_add_to_port_table): Don't set port's representation. * ports.h (scm_port_representation_type): Removed. (scm_string_representation_type): Removed. (struct scm_port_table ): Removed representation field. (SCM_PORT_REPRESENTATION): Removed. (SCM_SET_PORT_REPRESENTATION): Removed. * genio.h: Use new function names. * genio.c: Don't include "extchrs.h". (scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc): Removed. (scm_putc, scm_puts, scm_lfwrite): No longer static. (scm_getc): No longer static; handle line and column changes. (scm_ungetc): Renamed from scm_gen_ungetc. (scm_do_read_line): Renamed from scm_gen_read_line. * libguile.h: Don't include "extchrs.h" or "mbstrings.h" * extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed. --- libguile/ChangeLog | 58 +++ libguile/Makefile.am | 8 +- libguile/Makefile.in | 60 ++- libguile/arbiters.c | 8 +- libguile/async.c | 4 +- libguile/backtrace.c | 63 ++- libguile/debug.c | 10 +- libguile/dynl.c | 6 +- libguile/eq.c | 4 +- libguile/eval.c | 6 +- libguile/extchrs.h | 0 libguile/fluids.c | 6 +- libguile/gc.c | 15 +- libguile/gdbint.c | 2 +- libguile/genio.c | 681 ++++++++------------------------- libguile/genio.h | 17 +- libguile/{extchrs.c => gscm.c} | 0 libguile/gsubr.c | 10 +- libguile/hash.c | 4 +- libguile/init.c | 2 - libguile/ioext.c | 6 +- libguile/kw.c | 11 +- libguile/libguile.h | 4 +- libguile/mallocs.c | 6 +- libguile/mbstrings.c | 0 libguile/mbstrings.h | 0 libguile/numbers.c | 6 +- libguile/ports.c | 25 +- libguile/ports.h | 19 - libguile/print.c | 159 ++++---- libguile/read.c | 112 ++---- libguile/regex-posix.c | 4 +- libguile/root.c | 6 +- libguile/srcprop.c | 6 +- libguile/stackchk.c | 8 +- libguile/strop.c | 1 - libguile/struct.c | 9 +- libguile/symbols.c | 17 - libguile/symbols.h | 10 +- libguile/tag.c | 8 +- libguile/tags.h | 25 +- libguile/threads.c | 14 +- libguile/throw.c | 18 +- libguile/unif.c | 65 ++-- libguile/variable.c | 10 +- 45 files changed, 531 insertions(+), 982 deletions(-) delete mode 100644 libguile/extchrs.h rewrite libguile/genio.c (66%) rename libguile/{extchrs.c => gscm.c} (100%) delete mode 100644 libguile/mbstrings.c delete mode 100644 libguile/mbstrings.h diff --git a/libguile/ChangeLog b/libguile/ChangeLog index f9ec96505..c8435cdae 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,61 @@ +Tue Oct 14 22:03:06 1997 Tom Tromey + + * Makefile.in: Rebuilt. + * Makefile.am (libguile_la_SOURCES): Removed extchrs.c, + mbstrings.c. + (modinclude_HEADERS): Removed extchrs.h, mbstrings.h. + * unif.c (scm_vector_set_length_x): Don't handle multibyte + strings. + * tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed. + (scm_tag): Don't handle multibyte strings. + * read.c: Don't include mbstrings.h. + (scm_lreadr): Don't handle multibyte ports. + * kw.c: Don't include mbstrings.h. + * init.c: Don't include mbstrings.h. + (scm_boot_guile_1): Don't init mbstrings module. + * hash.c (scm_hasher): Don't handle mbstrings. + * gscm.c (gscm_run_scm): Don't init mbstrings module. + * gc.c (scm_gc_mark): Don't handle mbstrings. + (scm_gc_sweep): Likewise. + * eval.c (SCM_CEVAL): Don't handle mbstrings. + * eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD. + * tags.h (SCM_TYP7SD): Removed. + (SCM_TYP7D): Removed. + (scm_tc7_mb_string): Removed. + (scm_tc7_mb_substring): Removed. + * print.c (scm_iprin1): Handle char printing directly. Don't + handle mbstrings. + Don't include "mbstrings.h". + * symbols.c (scm_intern_obarray_soft, scm_string_to_symbol, + scm_string_to_obarray_symbol, msymbolize): Don't set symbol's + multi-byte flag. + Don't include "mbstrings.h". + * symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed. + (SCM_SYMBOL_SLOTS): Define as 4. + (SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD. + * arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c, + gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c, + print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c, + struct.c, threads.c, throw.c, unif.c, variable.c: Use new + ("gen"-less) I/O function names. + * ports.c (scm_add_to_port_table): Don't set port's + representation. + * ports.h (scm_port_representation_type): Removed. + (scm_string_representation_type): Removed. + (struct scm_port_table ): Removed representation field. + (SCM_PORT_REPRESENTATION): Removed. + (SCM_SET_PORT_REPRESENTATION): Removed. + * genio.h: Use new function names. + * genio.c: Don't include "extchrs.h". + (scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc): + Removed. + (scm_putc, scm_puts, scm_lfwrite): No longer static. + (scm_getc): No longer static; handle line and column changes. + (scm_ungetc): Renamed from scm_gen_ungetc. + (scm_do_read_line): Renamed from scm_gen_read_line. + * libguile.h: Don't include "extchrs.h" or "mbstrings.h" + * extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed. + 1997-10-12 Mark Galassi * gh_test_repl.c (c_vector_test): same as gh_test_c.c diff --git a/libguile/Makefile.am b/libguile/Makefile.am index f1f35a7c5..6f75fa612 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -17,11 +17,11 @@ guile_LDADD = libguile.la ${THREAD_LIBS} libguile_la_SOURCES = \ alist.c appinit.c arbiters.c async.c boolean.c chars.c \ - continuations.c dynl.c dynwind.c eq.c error.c eval.c extchrs.c \ + continuations.c dynl.c dynwind.c eq.c error.c eval.c \ feature.c filesys.c fports.c gc.c gdbint.c genio.c gh_data.c gh_eval.c \ gh_funcs.c gh_init.c gh_io.c gh_list.c gh_predicates.c gsubr.c hash.c \ hashtab.c init.c ioext.c kw.c list.c load.c mallocs.c markers.c \ - mbstrings.c net_db.c numbers.c objects.c objprop.c options.c pairs.c \ + net_db.c numbers.c objects.c objprop.c options.c pairs.c \ ports.c posix.c print.c procprop.c procs.c ramap.c read.c root.c \ scmsigs.c script.c simpos.c smob.c socket.c stackchk.c stime.c \ strings.c strop.c strorder.c strports.c struct.c symbols.c tag.c \ @@ -53,9 +53,9 @@ pkginclude_HEADERS = gh.h modincludedir = $(includedir)/libguile modinclude_HEADERS = __scm.h alist.h arbiters.h async.h \ backtrace.h boolean.h chars.h continuations.h debug.h dynl.h dynwind.h \ - eq.h error.h eval.h extchrs.h feature.h filesys.h fports.h gc.h \ + eq.h error.h eval.h feature.h filesys.h fports.h gc.h \ gdb_interface.h gdbint.h genio.h gsubr.h hash.h hashtab.h init.h \ - ioext.h kw.h list.h load.h mallocs.h markers.h mbstrings.h net_db.h \ + ioext.h kw.h list.h load.h mallocs.h markers.h net_db.h \ numbers.h objects.h objprop.h options.h pairs.h ports.h posix.h \ regex-posix.h print.h procprop.h procs.h ramap.h read.h root.h scmsigs.h \ script.h simpos.h smob.h socket.h srcprop.h stackchk.h stacks.h \ diff --git a/libguile/Makefile.in b/libguile/Makefile.in index 5e54ac53a..3373184d3 100644 --- a/libguile/Makefile.in +++ b/libguile/Makefile.in @@ -96,11 +96,11 @@ guile_LDADD = libguile.la ${THREAD_LIBS} libguile_la_SOURCES = \ alist.c appinit.c arbiters.c async.c boolean.c chars.c \ - continuations.c dynl.c dynwind.c eq.c error.c eval.c extchrs.c \ + continuations.c dynl.c dynwind.c eq.c error.c eval.c \ feature.c filesys.c fports.c gc.c gdbint.c genio.c gh_data.c gh_eval.c \ gh_funcs.c gh_init.c gh_io.c gh_list.c gh_predicates.c gsubr.c hash.c \ hashtab.c init.c ioext.c kw.c list.c load.c mallocs.c markers.c \ - mbstrings.c net_db.c numbers.c objects.c objprop.c options.c pairs.c \ + net_db.c numbers.c objects.c objprop.c options.c pairs.c \ ports.c posix.c print.c procprop.c procs.c ramap.c read.c root.c \ scmsigs.c script.c simpos.c smob.c socket.c stackchk.c stime.c \ strings.c strop.c strorder.c strports.c struct.c symbols.c tag.c \ @@ -128,9 +128,9 @@ pkginclude_HEADERS = gh.h modincludedir = $(includedir)/libguile modinclude_HEADERS = __scm.h alist.h arbiters.h async.h \ backtrace.h boolean.h chars.h continuations.h debug.h dynl.h dynwind.h \ - eq.h error.h eval.h extchrs.h feature.h filesys.h fports.h gc.h \ + eq.h error.h eval.h feature.h filesys.h fports.h gc.h \ gdb_interface.h gdbint.h genio.h gsubr.h hash.h hashtab.h init.h \ - ioext.h kw.h list.h load.h mallocs.h markers.h mbstrings.h net_db.h \ + ioext.h kw.h list.h load.h mallocs.h markers.h net_db.h \ numbers.h objects.h objprop.h options.h pairs.h ports.h posix.h \ regex-posix.h print.h procprop.h procs.h ramap.h read.h root.h scmsigs.h \ script.h simpos.h smob.h socket.h srcprop.h stackchk.h stacks.h \ @@ -178,16 +178,15 @@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libguile_la_OBJECTS = alist.lo appinit.lo arbiters.lo async.lo \ boolean.lo chars.lo continuations.lo dynl.lo dynwind.lo eq.lo error.lo \ -eval.lo extchrs.lo feature.lo filesys.lo fports.lo gc.lo gdbint.lo \ -genio.lo gh_data.lo gh_eval.lo gh_funcs.lo gh_init.lo gh_io.lo \ -gh_list.lo gh_predicates.lo gsubr.lo hash.lo hashtab.lo init.lo \ -ioext.lo kw.lo list.lo load.lo mallocs.lo markers.lo mbstrings.lo \ -net_db.lo numbers.lo objects.lo objprop.lo options.lo pairs.lo ports.lo \ -posix.lo print.lo procprop.lo procs.lo ramap.lo read.lo root.lo \ -scmsigs.lo script.lo simpos.lo smob.lo socket.lo stackchk.lo stime.lo \ -strings.lo strop.lo strorder.lo strports.lo struct.lo symbols.lo tag.lo \ -throw.lo unif.lo variable.lo vectors.lo version.lo vports.lo weaks.lo \ -fluids.lo +eval.lo feature.lo filesys.lo fports.lo gc.lo gdbint.lo genio.lo \ +gh_data.lo gh_eval.lo gh_funcs.lo gh_init.lo gh_io.lo gh_list.lo \ +gh_predicates.lo gsubr.lo hash.lo hashtab.lo init.lo ioext.lo kw.lo \ +list.lo load.lo mallocs.lo markers.lo net_db.lo numbers.lo objects.lo \ +objprop.lo options.lo pairs.lo ports.lo posix.lo print.lo procprop.lo \ +procs.lo ramap.lo read.lo root.lo scmsigs.lo script.lo simpos.lo \ +smob.lo socket.lo stackchk.lo stime.lo strings.lo strop.lo strorder.lo \ +strports.lo struct.lo symbols.lo tag.lo throw.lo unif.lo variable.lo \ +vectors.lo version.lo vports.lo weaks.lo fluids.lo PROGRAMS = $(bin_PROGRAMS) guile_OBJECTS = guile.o @@ -221,23 +220,22 @@ GZIP = --best DEP_FILES = .deps/alist.P .deps/alloca.P .deps/appinit.P \ .deps/arbiters.P .deps/async.P .deps/backtrace.P .deps/boolean.P \ .deps/chars.P .deps/continuations.P .deps/debug.P .deps/dynl.P \ -.deps/dynwind.P .deps/eq.P .deps/error.P .deps/eval.P .deps/extchrs.P \ -.deps/feature.P .deps/filesys.P .deps/fluids.P .deps/fports.P \ -.deps/gc.P .deps/gdbint.P .deps/genio.P .deps/gh_data.P .deps/gh_eval.P \ -.deps/gh_funcs.P .deps/gh_init.P .deps/gh_io.P .deps/gh_list.P \ -.deps/gh_predicates.P .deps/gh_test_c.P .deps/gh_test_repl.P \ -.deps/gsubr.P .deps/guile.P .deps/hash.P .deps/hashtab.P \ -.deps/inet_aton.P .deps/init.P .deps/ioext.P .deps/kw.P .deps/list.P \ -.deps/load.P .deps/mallocs.P .deps/markers.P .deps/mbstrings.P \ -.deps/net_db.P .deps/numbers.P .deps/objects.P .deps/objprop.P \ -.deps/options.P .deps/pairs.P .deps/ports.P .deps/posix.P .deps/print.P \ -.deps/procprop.P .deps/procs.P .deps/putenv.P .deps/ramap.P \ -.deps/read.P .deps/regex-posix.P .deps/root.P .deps/scmsigs.P \ -.deps/script.P .deps/simpos.P .deps/smob.P .deps/socket.P \ -.deps/srcprop.P .deps/stackchk.P .deps/stacks.P .deps/stime.P \ -.deps/strerror.P .deps/strings.P .deps/strop.P .deps/strorder.P \ -.deps/strports.P .deps/struct.P .deps/symbols.P .deps/tag.P \ -.deps/threads.P .deps/throw.P .deps/unif.P .deps/variable.P \ +.deps/dynwind.P .deps/eq.P .deps/error.P .deps/eval.P .deps/feature.P \ +.deps/filesys.P .deps/fluids.P .deps/fports.P .deps/gc.P .deps/gdbint.P \ +.deps/genio.P .deps/gh_data.P .deps/gh_eval.P .deps/gh_funcs.P \ +.deps/gh_init.P .deps/gh_io.P .deps/gh_list.P .deps/gh_predicates.P \ +.deps/gh_test_c.P .deps/gh_test_repl.P .deps/gsubr.P .deps/guile.P \ +.deps/hash.P .deps/hashtab.P .deps/inet_aton.P .deps/init.P \ +.deps/ioext.P .deps/kw.P .deps/list.P .deps/load.P .deps/mallocs.P \ +.deps/markers.P .deps/net_db.P .deps/numbers.P .deps/objects.P \ +.deps/objprop.P .deps/options.P .deps/pairs.P .deps/ports.P \ +.deps/posix.P .deps/print.P .deps/procprop.P .deps/procs.P \ +.deps/putenv.P .deps/ramap.P .deps/read.P .deps/regex-posix.P \ +.deps/root.P .deps/scmsigs.P .deps/script.P .deps/simpos.P .deps/smob.P \ +.deps/socket.P .deps/srcprop.P .deps/stackchk.P .deps/stacks.P \ +.deps/stime.P .deps/strerror.P .deps/strings.P .deps/strop.P \ +.deps/strorder.P .deps/strports.P .deps/struct.P .deps/symbols.P \ +.deps/tag.P .deps/threads.P .deps/throw.P .deps/unif.P .deps/variable.P \ .deps/vectors.P .deps/version.P .deps/vports.P .deps/weaks.P SOURCES = $(libguile_la_SOURCES) $(EXTRA_libguile_la_SOURCES) $(guile_SOURCES) $(gh_test_c_SOURCES) $(gh_test_repl_SOURCES) OBJECTS = $(libguile_la_OBJECTS) $(guile_OBJECTS) $(gh_test_c_OBJECTS) $(gh_test_repl_OBJECTS) diff --git a/libguile/arbiters.c b/libguile/arbiters.c index ab1b70386..a8788a715 100644 --- a/libguile/arbiters.c +++ b/libguile/arbiters.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,11 +63,11 @@ prinarb (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return !0; } diff --git a/libguile/async.c b/libguile/async.c index 1a0f74050..72f23e2ef 100644 --- a/libguile/async.c +++ b/libguile/async.c @@ -273,9 +273,9 @@ print_async (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc('>', port); return 1; } diff --git a/libguile/backtrace.c b/libguile/backtrace.c index 9c7a54072..571cfb8d2 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -79,14 +79,14 @@ display_header (source, port) if (SCM_NIMP (fname) && SCM_STRINGP (fname)) { scm_prin1 (fname, port, 0); - scm_gen_putc (':', port); + scm_putc (':', port); scm_prin1 (scm_source_property (source, scm_i_line), port, 0); - scm_gen_putc (':', port); + scm_putc (':', port); scm_prin1 (scm_source_property (source, scm_i_column), port, 0); } else - scm_gen_puts (scm_regular_string, "ERROR", port); - scm_gen_puts (scm_regular_string, ": ", port); + scm_puts ("ERROR", port); + scm_puts (": ", port); } @@ -104,7 +104,7 @@ scm_display_error_message (message, args, port) || !scm_list_p (args)) { scm_prin1 (message, port, 0); - scm_gen_putc ('\n', port); + scm_putc ('\n', port); return; } @@ -124,13 +124,13 @@ scm_display_error_message (message, args, port) else continue; - scm_gen_write (scm_regular_string, start, p - start - 1, port); + scm_lfwrite (start, p - start - 1, port); scm_prin1 (SCM_CAR (args), port, writingp); args = SCM_CDR (args); start = p + 1; } - scm_gen_write (scm_regular_string, start, p - start, port); - scm_gen_putc ('\n', port); + scm_lfwrite (start, p - start, port); + scm_putc ('\n', port); } static void display_expression SCM_P ((SCM frame, SCM pname, SCM source, SCM port)); @@ -152,24 +152,24 @@ display_expression (frame, pname, source, port) if (SCM_NIMP (frame) && SCM_FRAMEP (frame) && SCM_FRAME_EVAL_ARGS_P (frame)) - scm_gen_puts (scm_regular_string, "While evaluating arguments to ", port); + scm_puts ("While evaluating arguments to ", port); else - scm_gen_puts (scm_regular_string, "In procedure ", port); + scm_puts ("In procedure ", port); scm_iprin1 (pname, port, pstate); if (SCM_NIMP (source) && SCM_MEMOIZEDP (source)) { - scm_gen_puts (scm_regular_string, " in expression ", port); + scm_puts (" in expression ", port); pstate->writingp = 1; scm_iprin1 (scm_unmemoize (source), port, pstate); } } else if (SCM_NIMP (source)) { - scm_gen_puts (scm_regular_string, "In expression ", port); + scm_puts ("In expression ", port); pstate->writingp = 1; scm_iprin1 (scm_unmemoize (source), port, pstate); } - scm_gen_puts (scm_regular_string, ":\n", port); + scm_puts (":\n", port); scm_free_print_state (print_state); } @@ -229,13 +229,11 @@ display_error_handler (struct display_error_handler_data *data, SCM tag, SCM args) { SCM print_state = scm_make_print_state (); - scm_gen_puts (scm_regular_string, - "\nException during displaying of ", - data->port); - scm_gen_puts (scm_regular_string, data->mode, data->port); - scm_gen_puts (scm_regular_string, ": ", data->port); + scm_puts ("\nException during displaying of ", data->port); + scm_puts (data->mode, data->port); + scm_puts (": ", data->port); scm_iprin1 (tag, data->port, SCM_PRINT_STATE (print_state)); - scm_gen_putc ('\n', data->port); + scm_putc ('\n', data->port); return SCM_UNSPECIFIED; } @@ -265,7 +263,7 @@ indent (n, port) { int i; for (i = 0; i < n; ++i) - scm_gen_putc (' ', port); + scm_putc (' ', port); } static void display_frame_expr SCM_P ((char *hdr, SCM exp, char *tlr, int indentation, SCM sport, SCM port, scm_print_state *pstate)); @@ -282,11 +280,11 @@ display_frame_expr (hdr, exp, tlr, indentation, sport, port, pstate) if (SCM_NIMP (exp) && SCM_CONSP (exp)) { scm_iprlist (hdr, exp, tlr[0], port, pstate); - scm_gen_puts (scm_regular_string, &tlr[1], port); + scm_puts (&tlr[1], port); } else scm_iprin1 (exp, port, pstate); - scm_gen_putc ('\n', port); + scm_putc ('\n', port); } static void display_application SCM_P ((SCM frame, int indentation, SCM sport, SCM port, scm_print_state *pstate)); @@ -356,7 +354,7 @@ display_frame (frame, nfield, indentation, sport, port, pstate) if (!SCM_BACKWARDS_P && SCM_FRAME_OVERFLOW_P (frame)) { indent (nfield + 1 + indentation, port); - scm_gen_puts (scm_regular_string, "...\n", port); + scm_puts ("...\n", port); } /* Check size of frame number. */ @@ -370,7 +368,7 @@ display_frame (frame, nfield, indentation, sport, port, pstate) scm_iprin1 (SCM_MAKINUM (n), port, pstate); /* Real frame marker */ - scm_gen_putc (SCM_FRAME_REAL_P (frame) ? '*' : ' ', port); + scm_putc (SCM_FRAME_REAL_P (frame) ? '*' : ' ', port); /* Indentation. */ indent (indentation, port); @@ -398,7 +396,7 @@ display_frame (frame, nfield, indentation, sport, port, pstate) if (SCM_BACKWARDS_P && SCM_FRAME_OVERFLOW_P (frame)) { indent (nfield + 1 + indentation, port); - scm_gen_puts (scm_regular_string, "...\n", port); + scm_puts ("...\n", port); } } @@ -500,7 +498,7 @@ display_backtrace_body (struct display_backtrace_args *a, SCM jmpbuf) for (i = 0; j > 0; ++i) j /= 10; nfield = i ? i : 1; - scm_gen_puts (scm_regular_string, "Backtrace:\n", a->port); + scm_puts ("Backtrace:\n", a->port); /* Print frames. */ frame = scm_stack_ref (a->stack, SCM_MAKINUM (beg)); @@ -549,19 +547,16 @@ scm_backtrace () if (SCM_FALSEP (SCM_CDR (scm_has_shown_backtrace_hint_p_var)) && !SCM_BACKTRACE_P) { - scm_gen_puts (scm_regular_string, - "Type \"(debug-enable 'backtrace)\" if you would like " - "a backtrace\n" - "automatically if an error occurs in the future.\n", - scm_cur_outp); + scm_puts ("Type \"(debug-enable 'backtrace)\" if you would like " + "a backtrace\n" + "automatically if an error occurs in the future.\n", + scm_cur_outp); SCM_SETCDR (scm_has_shown_backtrace_hint_p_var, SCM_BOOL_T); } } else { - scm_gen_puts (scm_regular_string, - "No backtrace available.\n", - scm_cur_outp); + scm_puts ("No backtrace available.\n", scm_cur_outp); } return SCM_UNSPECIFIED; } diff --git a/libguile/debug.c b/libguile/debug.c index 7014e6ef0..612f0b00a 100644 --- a/libguile/debug.c +++ b/libguile/debug.c @@ -1,5 +1,5 @@ /* Debugging extensions for Guile - * Copyright (C) 1995, 1996 Free Software Foundation + * Copyright (C) 1995, 1996, 1997 Free Software Foundation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -140,11 +140,11 @@ prinmemoized (obj, port, pstate) scm_print_state *pstate; { int writingp = SCM_WRITINGP (pstate); - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return 1; } @@ -353,9 +353,9 @@ prindebugobj (obj, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return 1; } diff --git a/libguile/dynl.c b/libguile/dynl.c index d81a6fa4f..3c4915159 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -321,11 +321,11 @@ print_dynl_obj (exp, port, pstate) scm_print_state *pstate; { struct dynl_obj *d = (struct dynl_obj *)SCM_CDR (exp); - scm_gen_puts (scm_regular_string, "#filename, port, pstate); if (d->handle == NULL) - scm_gen_puts (scm_regular_string, " (unlinked)", port); - scm_gen_putc ('>', port); + scm_puts (" (unlinked)", port); + scm_putc ('>', port); return 1; } diff --git a/libguile/eq.c b/libguile/eq.c index 7e9d4a45f..e903b4bb4 100644 --- a/libguile/eq.c +++ b/libguile/eq.c @@ -106,8 +106,8 @@ scm_equal_p (x, y) y = SCM_CDR(y); goto tailrecurse; } - if (SCM_TYP7SD (x) == scm_tc7_string - && SCM_TYP7SD (y) == scm_tc7_string) + if (SCM_TYP7S (x) == scm_tc7_string + && SCM_TYP7S (y) == scm_tc7_string) return scm_string_equal_p (x, y); /* This ensures that types and scm_length are the same. */ if (SCM_CAR(x) != SCM_CAR(y)) return SCM_BOOL_F; diff --git a/libguile/eval.c b/libguile/eval.c index a709d4f69..02c342df7 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1938,9 +1938,7 @@ dispatch: case scm_tc7_llvect: #endif case scm_tc7_string: - case scm_tc7_mb_string: case scm_tc7_substring: - case scm_tc7_mb_substring: case scm_tc7_smob: case scm_tcs_closures: case scm_tcs_subrs: @@ -3060,11 +3058,11 @@ prinprom (exp, port, pstate) scm_print_state *pstate; { int writingp = SCM_WRITINGP (pstate); - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return !0; } diff --git a/libguile/extchrs.h b/libguile/extchrs.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/libguile/fluids.c b/libguile/fluids.c index 91419d8eb..f3273f6f4 100644 --- a/libguile/fluids.c +++ b/libguile/fluids.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -105,9 +105,9 @@ print_fluid (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return 1; } diff --git a/libguile/gc.c b/libguile/gc.c index a5f66a42b..7c0792bff 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -712,12 +712,10 @@ gc_mark_nimp: #endif case scm_tc7_string: - case scm_tc7_mb_string: SCM_SETGC8MARK (ptr); break; case scm_tc7_substring: - case scm_tc7_mb_substring: if (SCM_GC8MARKP(ptr)) break; SCM_SETGC8MARK (ptr); @@ -735,12 +733,9 @@ gc_mark_nimp: sizeof (SCM *) * (scm_weak_size *= 2))); if (scm_weak_vectors == NULL) { - scm_gen_puts (scm_regular_string, - "weak vector table", - scm_cur_errp); - scm_gen_puts (scm_regular_string, - "\nFATAL ERROR DURING CRITICAL SCM_CODE SECTION\n", - scm_cur_errp); + scm_puts ("weak vector table", scm_cur_errp); + scm_puts ("\nFATAL ERROR DURING CRITICAL SCM_CODE SECTION\n", + scm_cur_errp); exit(SCM_EXIT_FAILURE); } } @@ -1173,12 +1168,10 @@ scm_gc_sweep () m += SCM_HUGE_LENGTH (scmptr) * 2 * sizeof (double); goto freechars; case scm_tc7_substring: - case scm_tc7_mb_substring: if (SCM_GC8MARKP (scmptr)) goto c8mrkcontinue; break; case scm_tc7_string: - case scm_tc7_mb_string: if (SCM_GC8MARKP (scmptr)) goto c8mrkcontinue; m += SCM_HUGE_LENGTH (scmptr) + 1; diff --git a/libguile/gdbint.c b/libguile/gdbint.c index 64a3e1bd5..33afc1bfa 100644 --- a/libguile/gdbint.c +++ b/libguile/gdbint.c @@ -1,5 +1,5 @@ /* GDB interface for Guile - * Copyright (C) 1996 Free Software Foundation + * Copyright (C) 1996, 1997 Free Software Foundation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/libguile/genio.c b/libguile/genio.c dissimilarity index 66% index 889323e3b..328b9edd3 100644 --- a/libguile/genio.c +++ b/libguile/genio.c @@ -1,521 +1,160 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA - * - * As a special exception, the Free Software Foundation gives permission - * for additional uses of the text contained in its release of GUILE. - * - * The exception is that, if you link the GUILE library with other files - * to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the GUILE library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the - * Free Software Foundation under the name GUILE. If you copy - * code from other Free Software Foundation releases into a copy of - * GUILE, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for GUILE, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. */ - -#include "extchrs.h" -#include -#include "_scm.h" -#include "chars.h" - -#include "genio.h" - -#ifdef HAVE_STRING_H -#include -#endif - - - - -static void scm_putc SCM_P ((int c, SCM port)); - -static void -scm_putc (c, port) - int c; - SCM port; -{ - scm_sizet i = SCM_PTOBNUM (port); - SCM_SYSCALL ((scm_ptobs[i].fputc) (c, SCM_STREAM (port))); -} - - - -static void scm_puts SCM_P ((char *s, SCM port)); - -static void -scm_puts (s, port) - char *s; - SCM port; -{ - scm_sizet i = SCM_PTOBNUM (port); - SCM_SYSCALL ((scm_ptobs[i].fputs) (s, SCM_STREAM (port))); -#ifdef TRANSCRIPT_SUPPORT - if (scm_trans && (port == def_outp || port == cur_errp)) - SCM_SYSCALL (fputs (s, scm_trans)); -#endif -} - - - -static int scm_lfwrite SCM_P ((char *ptr, scm_sizet size, scm_sizet nitems, SCM port)); - -static int -scm_lfwrite (ptr, size, nitems, port) - char *ptr; - scm_sizet size; - scm_sizet nitems; - SCM port; -{ - int ret; - scm_sizet i = SCM_PTOBNUM (port); - SCM_SYSCALL (ret = (scm_ptobs[i].fwrite(ptr, size, nitems, SCM_STREAM (port)))); -#ifdef TRANSCRIPT_SUPPORT - if (scm_trans && (port == def_outp || port == cur_errp)) - SCM_SYSCALL (fwrite (ptr, size, nitems, scm_trans)); -#endif - return ret; -} - - - - - -void -scm_gen_putc (c, port) - int c; - SCM port; -{ - switch (SCM_PORT_REPRESENTATION (port)) - { - case scm_regular_port: - { - /* Nothing good to do with extended chars here... - * just truncate them. - */ - scm_putc ((unsigned char)c, port); - break; - } - - case scm_mb_port: - { - char buf[256]; - int len; - - SCM_ASSERT (XMB_CUR_MAX < sizeof (buf), SCM_MAKICHR (c), - "huge translation", "scm_gen_putc"); - - len = xwctomb (buf, c); - - SCM_ASSERT ((len >= 0), SCM_MAKICHR (c), "bogus character", "scm_gen_putc"); - - if (len == 0) - scm_putc (0, port); - else - { - int x; - for (x = 0; x < len; ++x) - scm_putc (buf[x], port); - } - break; - } - - case scm_wchar_port: - { - scm_putc (((unsigned char)(c >> 8) & 0xff), port); - scm_putc ((unsigned char)(c & 0xff), port); - break; - } - } -} - - - - - - -void -scm_gen_puts (rep, str_data, port) - enum scm_string_representation_type rep; - char *str_data; - SCM port; -{ - switch (rep) - { - - case scm_regular_string: - switch (SCM_PORT_REPRESENTATION (port)) - { - case scm_regular_port: - case scm_mb_port: - scm_puts (str_data, port); - return; - case scm_wchar_port: - { - while (*str_data) - { - scm_putc (0, port); - scm_putc (*str_data, port); - ++str_data; - } - return; - } - } - - case scm_mb_string: - switch (SCM_PORT_REPRESENTATION (port)) - { - case scm_regular_port: - case scm_mb_port: - scm_puts (str_data, port); - return; - case scm_wchar_port: - { - xwchar_t output; - int len; - int size; - - size = strlen (str_data); - while (size) - { - len = xmbtowc (&output, str_data, size); - SCM_ASSERT ((len > 0), SCM_MAKINUM (*str_data), - "bogus character", "scm_gen_puts"); - scm_putc ((output >> 8) & 0xff, port); - scm_putc (output & 0xff, port); - size -= len; - str_data += len; - } - return; - } - } - - case scm_wchar_string: - { - xwchar_t * wstr_data; - - wstr_data = (xwchar_t *) str_data; - switch (SCM_PORT_REPRESENTATION (port)) - { - case scm_regular_port: - while (*wstr_data) - { - scm_putc ((unsigned char) *wstr_data, port); - ++wstr_data; - } - return; - - case scm_mb_port: - { - char buf[256]; - SCM_ASSERT (XMB_CUR_MAX < sizeof (buf), SCM_BOOL_F, - "huge translation", "scm_gen_puts"); - - while (*wstr_data) - { - int len; - - len = xwctomb (buf, *wstr_data); - - SCM_ASSERT ((len > 0), SCM_MAKINUM (*wstr_data), "bogus character", "scm_gen_puts"); - - { - int x; - for (x = 0; x < len; ++x) - scm_putc (buf[x], port); - } - ++wstr_data; - } - return; - } - - case scm_wchar_port: - { - int len; - for (len = 0; wstr_data[len]; ++len) - ; - scm_lfwrite (str_data, sizeof (xwchar_t), len, port); - return; - } - } - } - } -} - - - - - -void -scm_gen_write (rep, str_data, nitems, port) - enum scm_string_representation_type rep; - char *str_data; - scm_sizet nitems; - SCM port; -{ - /* is nitems bytes or characters in the mb_string case? */ - - switch (rep) - { - case scm_regular_string: - switch (SCM_PORT_REPRESENTATION (port)) - { - case scm_regular_port: - case scm_mb_port: - scm_lfwrite (str_data, 1, nitems, port); - return; - case scm_wchar_port: - { - while (nitems) - { - scm_putc (0, port); - scm_putc (*str_data, port); - ++str_data; - --nitems; - } - return; - } - } - - case scm_mb_string: - switch (SCM_PORT_REPRESENTATION (port)) - { - case scm_regular_port: - case scm_mb_port: - scm_lfwrite (str_data, 1, nitems, port); - return; - - case scm_wchar_port: - { - xwchar_t output; - int len; - - while (nitems) - { - len = xmbtowc (&output, str_data, nitems); - SCM_ASSERT ((len > 0), SCM_MAKINUM (*str_data), "bogus character", "scm_gen_puts"); - scm_putc ((output >> 8) & 0xff, port); - scm_putc (output & 0xff, port); - nitems -= len; - str_data += len; - } - return; - } - } - - case scm_wchar_string: - { - xwchar_t * wstr_data; - - wstr_data = (xwchar_t *) str_data; - switch (SCM_PORT_REPRESENTATION (port)) - { - case scm_regular_port: - while (nitems) - { - scm_putc ((unsigned char) *wstr_data, port); - ++wstr_data; - --nitems; - } - return; - - case scm_mb_port: - { - char buf[256]; - SCM_ASSERT (XMB_CUR_MAX < sizeof (buf), SCM_BOOL_F, - "huge translation", "scm_gen_puts"); - - while (nitems) - { - int len; - - len = xwctomb (buf, *wstr_data); - - SCM_ASSERT ((len > 0), SCM_MAKINUM (*wstr_data), "bogus character", "scm_gen_puts"); - - { - int x; - for (x = 0; x < len; ++x) - scm_putc (buf[x], port); - } - ++wstr_data; - --nitems; - } - return; - } - - case scm_wchar_port: - { - scm_lfwrite (str_data, sizeof (xwchar_t), nitems, port); - return; - } - } - } - } -} - - - - - -static int scm_getc SCM_P ((SCM port)); - -static int -scm_getc (port) - SCM port; -{ - SCM f; - int c; - scm_sizet i; - - f = SCM_STREAM (port); - i = SCM_PTOBNUM (port); - SCM_SYSCALL (c = (scm_ptobs[i].fgetc) (f)); - return c; -} - - -int -scm_gen_getc (port) - SCM port; -{ - int c; - - /* One char may be stored in the high bits of (car port) orre@nada.kth.se. */ - if (SCM_CRDYP (port)) - { - c = SCM_CGETUN (port); - SCM_CLRDY (port); /* Clear ungetted char */ - - return_c: - if (c == '\n') - { - SCM_INCLINE (port); - } - else if (c == '\t') - { - SCM_TABCOL (port); - } - else - { - SCM_INCCOL (port); - } - return c; - } - - - switch (SCM_PORT_REPRESENTATION (port)) - { - case scm_regular_port: - c = scm_getc (port); - goto return_c; - - case scm_mb_port: - { - int x; - char buf[256]; - - SCM_ASSERT (XMB_CUR_MAX < sizeof (buf), SCM_BOOL_F, - "huge translation", "scm_gen_puts"); - - x = 0; - while (1) - { - xwchar_t out; - c = scm_getc (port); - - if (c == EOF) - return EOF; - - buf[x] = c; - - if (xmbtowc (&out, buf, x + 1) > 0) - { - c = out; - goto return_c; - } - - SCM_ASSERT (x < sizeof (buf), SCM_BOOL_F, - "huge translation", "scm_gen_getc"); - ++x; - } - } - - - case scm_wchar_port: - { - int hi; - int lo; - hi = scm_getc (port); - lo = (hi == EOF - ? EOF - : scm_getc (port)); - c = ((hi == EOF) - ? EOF - : ((hi << 8) | lo)); - goto return_c; - } - - - default: - return EOF; - } -} - - -void -scm_gen_ungetc (c, port) - int c; - SCM port; -{ -/* SCM_ASSERT(!SCM_CRDYP(port), port, SCM_ARG2, "too many scm_gen_ungetc");*/ - SCM_CUNGET (c, port); - if (c == '\n') - { - /* What should col be in this case? - * We'll leave it at -1. - */ - SCM_LINUM (port) -= 1; - } - else - SCM_COL(port) -= 1; -} - - -char * -scm_gen_read_line (port) - SCM port; -{ - char *s; - scm_sizet i; - - i = SCM_PTOBNUM (port); - SCM_SYSCALL (s = (scm_ptobs[i].fgets) (port)); - return s; -} - +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + * + * As a special exception, the Free Software Foundation gives permission + * for additional uses of the text contained in its release of GUILE. + * + * The exception is that, if you link the GUILE library with other files + * to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the GUILE library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the + * Free Software Foundation under the name GUILE. If you copy + * code from other Free Software Foundation releases into a copy of + * GUILE, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for GUILE, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. */ + +#include +#include "_scm.h" +#include "chars.h" + +#include "genio.h" + +#ifdef HAVE_STRING_H +#include +#endif + + +void +scm_putc (c, port) + int c; + SCM port; +{ + scm_sizet i = SCM_PTOBNUM (port); + SCM_SYSCALL ((scm_ptobs[i].fputc) (c, SCM_STREAM (port))); +} + +void +scm_puts (s, port) + char *s; + SCM port; +{ + scm_sizet i = SCM_PTOBNUM (port); + SCM_SYSCALL ((scm_ptobs[i].fputs) (s, SCM_STREAM (port))); +#ifdef TRANSCRIPT_SUPPORT + if (scm_trans && (port == def_outp || port == cur_errp)) + SCM_SYSCALL (fputs (s, scm_trans)); +#endif +} + +void +scm_lfwrite (ptr, size, port) + char *ptr; + scm_sizet size; + SCM port; +{ + scm_sizet i = SCM_PTOBNUM (port); + SCM_SYSCALL (scm_ptobs[i].fwrite(ptr, size, 1, SCM_STREAM (port))); +#ifdef TRANSCRIPT_SUPPORT + if (scm_trans && (port == def_outp || port == cur_errp)) + SCM_SYSCALL (fwrite (ptr, size, 1, scm_trans)); +#endif +} + + + + +int +scm_getc (port) + SCM port; +{ + SCM f; + int c; + scm_sizet i; + + /* One char may be stored in the high bits of (car port) orre@nada.kth.se. */ + if (SCM_CRDYP (port)) + { + c = SCM_CGETUN (port); + SCM_CLRDY (port); /* Clear ungetted char */ + } + else + { + f = SCM_STREAM (port); + i = SCM_PTOBNUM (port); + SCM_SYSCALL (c = (scm_ptobs[i].fgetc) (f)); + } + + if (c == '\n') + { + SCM_INCLINE (port); + } + else if (c == '\t') + { + SCM_TABCOL (port); + } + else + { + SCM_INCCOL (port); + } + + return c; +} + + +void +scm_ungetc (c, port) + int c; + SCM port; +{ +/* SCM_ASSERT(!SCM_CRDYP(port), port, SCM_ARG2, "too many scm_ungetc");*/ + SCM_CUNGET (c, port); + if (c == '\n') + { + /* What should col be in this case? + * We'll leave it at -1. + */ + SCM_LINUM (port) -= 1; + } + else + SCM_COL(port) -= 1; +} + + +char * +scm_do_read_line (port) + SCM port; +{ + char *s; + scm_sizet i; + + i = SCM_PTOBNUM (port); + SCM_SYSCALL (s = (scm_ptobs[i].fgets) (port)); + return s; +} + diff --git a/libguile/genio.h b/libguile/genio.h index 25272d03e..e765b9a71 100644 --- a/libguile/genio.h +++ b/libguile/genio.h @@ -2,7 +2,7 @@ #ifndef GENIOH #define GENIOH -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,13 +48,12 @@ -extern void scm_gen_putc SCM_P ((int c, SCM port)); -extern void scm_gen_puts SCM_P ((enum scm_string_representation_type rep, - char *str_data, - SCM port)); -extern void scm_gen_write SCM_P ((enum scm_string_representation_type rep, char *str_data, scm_sizet nitems, SCM port)); -extern int scm_gen_getc SCM_P ((SCM port)); -extern void scm_gen_ungetc SCM_P ((int c, SCM port)); -extern char *scm_gen_read_line SCM_P ((SCM port)); +extern void scm_putc SCM_P ((int c, SCM port)); +extern void scm_puts SCM_P ((char *str_data, SCM port)); +extern void scm_lfwrite SCM_P ((char *ptr, scm_sizet size, SCM port)); +extern int scm_getc SCM_P ((SCM port)); +extern void scm_ungetc SCM_P ((int c, SCM port)); +/* FIXME: this is a terrible name. */ +extern char *scm_do_read_line SCM_P ((SCM port)); #endif /* GENIOH */ diff --git a/libguile/extchrs.c b/libguile/gscm.c similarity index 100% rename from libguile/extchrs.c rename to libguile/gscm.c diff --git a/libguile/gsubr.c b/libguile/gsubr.c index c42661e15..266efc3b6 100644 --- a/libguile/gsubr.c +++ b/libguile/gsubr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -172,13 +172,13 @@ SCM gsubr_21l(req1, req2, opt, rst) SCM req1, req2, opt, rst; { - scm_gen_puts (scm_regular_string, "gsubr-2-1-l:\n req1: ", scm_cur_outp); + scm_puts ("gsubr-2-1-l:\n req1: ", scm_cur_outp); scm_display(req1, scm_cur_outp); - scm_gen_puts (scm_regular_string, "\n req2: ", scm_cur_outp); + scm_puts ("\n req2: ", scm_cur_outp); scm_display(req2, scm_cur_outp); - scm_gen_puts (scm_regular_string, "\n opt: ", scm_cur_outp); + scm_puts ("\n opt: ", scm_cur_outp); scm_display(opt, scm_cur_outp); - scm_gen_puts (scm_regular_string, "\n rest: ", scm_cur_outp); + scm_puts ("\n rest: ", scm_cur_outp); scm_display(rst, scm_cur_outp); scm_newline(scm_cur_outp); return SCM_UNSPECIFIED; diff --git a/libguile/hash.c b/libguile/hash.c index 2bcd14d16..b902ea128 100644 --- a/libguile/hash.c +++ b/libguile/hash.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,9 +98,7 @@ scm_hasher(obj, n, d) } case scm_tcs_symbols: case scm_tc7_string: - case scm_tc7_mb_string: case scm_tc7_substring: - case scm_tc7_mb_substring: return scm_strhash(SCM_ROUCHARS(obj), (scm_sizet) SCM_ROLENGTH(obj), n); case scm_tc7_wvect: case scm_tc7_vector: diff --git a/libguile/init.c b/libguile/init.c index e017815be..e40fca10a 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -73,7 +73,6 @@ #include "list.h" #include "load.h" #include "mallocs.h" -#include "mbstrings.h" #include "net_db.h" #include "numbers.h" #include "objects.h" @@ -443,7 +442,6 @@ scm_boot_guile_1 (base, closure) scm_init_stime (); scm_init_strings (); scm_init_strorder (); - scm_init_mbstrings (); scm_init_strop (); scm_init_throw (); scm_init_variable (); diff --git a/libguile/ioext.c b/libguile/ioext.c index b47c15076..69515e9d3 100644 --- a/libguile/ioext.c +++ b/libguile/ioext.c @@ -117,13 +117,13 @@ scm_read_delimited_x (delims, buf, gobble, port, start, end) { int k; - c = scm_gen_getc (port); + c = scm_getc (port); for (k = 0; k < num_delims; k++) { if (cdelims[k] == c) { if (SCM_FALSEP (gobble)) - scm_gen_ungetc (c, port); + scm_ungetc (c, port); return scm_cons (SCM_MAKICHR (c), scm_long2num (j - cstart)); @@ -154,7 +154,7 @@ scm_read_line (port) port, SCM_ARG1, s_read_line); } - s = scm_gen_read_line (port); + s = scm_do_read_line (port); return (s == NULL ? SCM_EOF_VAL : scm_makfrom0str (s)); } diff --git a/libguile/kw.c b/libguile/kw.c index e60cba90f..ce3c6dc05 100644 --- a/libguile/kw.c +++ b/libguile/kw.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,7 +43,6 @@ #include #include "_scm.h" #include "genio.h" -#include "mbstrings.h" #include "smob.h" #include "kw.h" @@ -68,12 +67,8 @@ prin_kw (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#:", port); - scm_gen_puts((SCM_MB_STRINGP(SCM_CDR (exp)) - ? scm_mb_string - : scm_regular_string), - 1 + SCM_CHARS (SCM_CDR (exp)), - port); + scm_puts ("#:", port); + scm_puts(1 + SCM_CHARS (SCM_CDR (exp)), port); return 1; } diff --git a/libguile/libguile.h b/libguile/libguile.h index 359c5a491..8e0ef8ab5 100644 --- a/libguile/libguile.h +++ b/libguile/libguile.h @@ -1,7 +1,7 @@ #ifndef LIBGUILEH #define LIBGUILEH -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,7 +68,6 @@ #include "libguile/eq.h" #include "libguile/error.h" #include "libguile/eval.h" -#include "libguile/extchrs.h" #include "libguile/feature.h" #include "libguile/filesys.h" #include "libguile/fports.h" @@ -85,7 +84,6 @@ #include "libguile/load.h" #include "libguile/mallocs.h" #include "libguile/markers.h" -#include "libguile/mbstrings.h" #include "libguile/net_db.h" #include "libguile/numbers.h" #include "libguile/objprop.h" diff --git a/libguile/mallocs.c b/libguile/mallocs.c index e086f228d..b2f48cdd8 100644 --- a/libguile/mallocs.c +++ b/libguile/mallocs.c @@ -1,6 +1,6 @@ /* classes: src_files */ -/* Copyright (C) 1995 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,9 +58,9 @@ prinmalloc (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts(scm_regular_string, "#', port); + scm_putc('>', port); return 1; } diff --git a/libguile/mbstrings.c b/libguile/mbstrings.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/libguile/mbstrings.h b/libguile/mbstrings.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/libguile/numbers.c b/libguile/numbers.c index d3ed2b770..e5a69e96e 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1441,7 +1441,7 @@ scm_floprint(sexp, port, pstate) { #ifdef SCM_FLOATS char num_buf[SCM_FLOBUFLEN]; - scm_gen_write (scm_regular_string, num_buf, iflo2str(sexp, num_buf), port); + scm_lfwrite (num_buf, iflo2str(sexp, num_buf), port); #else scm_ipruk("float", sexp, port); #endif @@ -1458,7 +1458,7 @@ scm_bigprint(exp, port, pstate) { #ifdef SCM_BIGDIG exp = big2str(exp, (unsigned int)10); - scm_gen_write (scm_regular_string, SCM_CHARS(exp), (scm_sizet)SCM_LENGTH(exp), port); + scm_lfwrite (SCM_CHARS(exp), (scm_sizet)SCM_LENGTH(exp), port); #else scm_ipruk("bignum", exp, port); #endif diff --git a/libguile/ports.c b/libguile/ports.c index d1f3cc67b..5a801148f 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -258,7 +258,6 @@ scm_add_to_port_table (port) scm_port_table[scm_port_table_size]->file_name = SCM_BOOL_F; scm_port_table[scm_port_table_size]->line_number = 1; scm_port_table[scm_port_table_size]->column_number = 0; - scm_port_table[scm_port_table_size]->representation = scm_regular_port; return scm_port_table[scm_port_table_size++]; } @@ -543,7 +542,7 @@ scm_read_char (port) port = scm_cur_inp; else SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port), port, SCM_ARG1, s_read_char); - c = scm_gen_getc (port); + c = scm_getc (port); if (EOF == c) return SCM_EOF_VAL; return SCM_MAKICHR (c); @@ -561,10 +560,10 @@ scm_peek_char (port) port = scm_cur_inp; else SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port), port, SCM_ARG1, s_peek_char); - c = scm_gen_getc (port); + c = scm_getc (port); if (EOF == c) return SCM_EOF_VAL; - scm_gen_ungetc (c, port); + scm_ungetc (c, port); return SCM_MAKICHR (c); } @@ -642,7 +641,7 @@ scm_unread_char (cobj, port) c = SCM_ICHR (cobj); - scm_gen_ungetc (c, port); + scm_ungetc (c, port); return cobj; } @@ -765,25 +764,25 @@ scm_prinport (exp, port, type) SCM port; char *type; { - scm_gen_puts (scm_regular_string, "#<", port); + scm_puts ("#<", port); if (SCM_CLOSEDP (exp)) - scm_gen_puts (scm_regular_string, "closed: ", port); + scm_puts ("closed: ", port); else { if (SCM_RDNG & SCM_CAR (exp)) - scm_gen_puts (scm_regular_string, "input: ", port); + scm_puts ("input: ", port); if (SCM_WRTNG & SCM_CAR (exp)) - scm_gen_puts (scm_regular_string, "output: ", port); + scm_puts ("output: ", port); } - scm_gen_puts (scm_regular_string, type, port); - scm_gen_putc (' ', port); + scm_puts (type, port); + scm_putc (' ', port); #ifndef MSDOS #ifndef __EMX__ #ifndef _DCC #ifndef AMIGA #ifndef THINK_C if (SCM_OPENP (exp) && scm_tc16_fport == SCM_TYP16 (exp) && isatty (fileno ((FILE *)SCM_STREAM (exp)))) - scm_gen_puts (scm_regular_string, ttyname (fileno ((FILE *)SCM_STREAM (exp))), port); + scm_puts (ttyname (fileno ((FILE *)SCM_STREAM (exp))), port); else #endif #endif @@ -794,7 +793,7 @@ scm_prinport (exp, port, type) scm_intprint ((long) fileno ((FILE *)SCM_STREAM (exp)), 10, port); else scm_intprint (SCM_CDR (exp), 16, port); - scm_gen_putc ('>', port); + scm_putc ('>', port); } diff --git a/libguile/ports.h b/libguile/ports.h index 2c81b72f6..8d2c4edf0 100644 --- a/libguile/ports.h +++ b/libguile/ports.h @@ -50,21 +50,6 @@ -enum scm_port_representation_type -{ - scm_regular_port, - scm_mb_port, - scm_wchar_port -}; - -enum scm_string_representation_type -{ - scm_regular_string = scm_regular_port, - scm_mb_string = scm_mb_port, - scm_wchar_string = scm_wchar_port -}; - - struct scm_port_table { SCM port; /* Open port. */ @@ -78,8 +63,6 @@ struct scm_port_table int line_number; /* debugging support. */ int column_number; /* debugging support. */ - - enum scm_port_representation_type representation; }; extern struct scm_port_table **scm_port_table; @@ -124,8 +107,6 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table. */ #define SCM_COL(x) SCM_PTAB_ENTRY(x)->column_number #define SCM_REVEALED(x) SCM_PTAB_ENTRY(x)->revealed #define SCM_SETREVEALED(x,s) (SCM_PTAB_ENTRY(x)->revealed = s) -#define SCM_PORT_REPRESENTATION(x) SCM_PTAB_ENTRY(x)->representation -#define SCM_SET_PORT_REPRESENTATION(x,s) (SCM_PTAB_ENTRY(x)->representation = s) #define SCM_CRDYP(port) (SCM_CAR (port) & SCM_CRDY) #define SCM_CLRDY(port) {SCM_SETAND_CAR (port, SCM_CUC);} #define SCM_SETRDY(port) {SCM_SETOR_CAR (port, SCM_CRDY);} diff --git a/libguile/print.c b/libguile/print.c index 6f2b83190..ec7d2fcd5 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -44,7 +44,6 @@ #include "_scm.h" #include "chars.h" #include "genio.h" -#include "mbstrings.h" #include "smob.h" #include "eval.h" #include "procprop.h" @@ -146,7 +145,7 @@ scm_print_options (setting) { \ if (pstate->top - pstate->list_offset >= pstate->level) \ { \ - scm_gen_putc ('#', port); \ + scm_putc ('#', port); \ return; \ } \ } \ @@ -222,9 +221,9 @@ print_state_printer (obj, port) SCM_ARG2, s_print_state_printer); port = SCM_COERCE_OPORT (port); - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return SCM_UNSPECIFIED; } @@ -287,9 +286,9 @@ print_circref (port, pstate, ref) for (i = pstate->top - 1; 1; --i) if (pstate->ref_stack[i] == ref) break; - scm_gen_putc ('#', port); + scm_putc ('#', port); scm_intprint (i - self, 10, port); - scm_gen_putc ('#', port); + scm_putc ('#', port); } /* Print generally. Handles both write and display according to PSTATE. @@ -314,17 +313,27 @@ taloop: if (SCM_ICHRP (exp)) { i = SCM_ICHR (exp); - scm_put_wchar (i, port, SCM_WRITINGP (pstate)); - + if (SCM_WRITINGP (pstate)) + { + scm_puts ("#\\", port); + if ((i >= 0) && (i <= ' ') && scm_charnames[i]) + scm_puts (scm_charnames[i], port); + else if (i < 0 || i > '\177') + scm_intprint (i, 8, port); + else + scm_putc (i, port); + } + else + scm_putc (i, port); } else if (SCM_IFLAGP (exp) && (SCM_ISYMNUM (exp) < (sizeof scm_isymnames / sizeof (char *)))) - scm_gen_puts (scm_regular_string, SCM_ISYMCHARS (exp), port); + scm_puts (SCM_ISYMCHARS (exp), port); else if (SCM_ILOCP (exp)) { - scm_gen_puts (scm_regular_string, "#@", port); + scm_puts ("#@", port); scm_intprint ((long) SCM_IFRAME (exp), 10, port); - scm_gen_putc (SCM_ICDRP (exp) ? '-' : '+', port); + scm_putc (SCM_ICDRP (exp) ? '-' : '+', port); scm_intprint ((long) SCM_IDIST (exp), 10, port); } else @@ -332,7 +341,7 @@ taloop: break; case 1: /* gloc */ - scm_gen_puts (scm_regular_string, "#@", port); + scm_puts ("#@", port); exp = SCM_CAR (exp - 1); goto taloop; default: @@ -380,21 +389,20 @@ taloop: if (!SCM_CLOSUREP (SCM_CDR (exp))) { code = env = 0; - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); } } else - scm_gen_putc ('>', port); + scm_putc ('>', port); } break; - case scm_tc7_mb_string: - case scm_tc7_mb_substring: - scm_print_mb_string (exp, port, SCM_WRITINGP (pstate)); - break; case scm_tc7_substring: case scm_tc7_string: if (SCM_WRITINGP (pstate)) { - scm_gen_putc ('"', port); + scm_putc ('"', port); for (i = 0; i < SCM_ROLENGTH (exp); ++i) switch (SCM_ROCHARS (exp)[i]) { case '"': case '\\': - scm_gen_putc ('\\', port); + scm_putc ('\\', port); default: - scm_gen_putc (SCM_ROCHARS (exp)[i], port); + scm_putc (SCM_ROCHARS (exp)[i], port); } - scm_gen_putc ('"', port); + scm_putc ('"', port); break; } else - scm_gen_write (scm_regular_string, SCM_ROCHARS (exp), - (scm_sizet) SCM_ROLENGTH (exp), - port); + scm_lfwrite (SCM_ROCHARS (exp), (scm_sizet) SCM_ROLENGTH (exp), + port); break; case scm_tcs_symbols: - if (SCM_MB_STRINGP (exp)) - { - scm_print_mb_symbol (exp, port); - break; - } - else { int pos; int end; @@ -486,7 +482,7 @@ taloop: maybe_weird = 0; if (len == 0) - scm_gen_write (scm_regular_string, "#{}#", 4, port); + scm_lfwrite ("#{}#", 4, port); for (end = pos; end < len; ++end) switch (str[end]) @@ -509,18 +505,18 @@ taloop: } if (!weird) { - scm_gen_write (scm_regular_string, "#{", 2, port); + scm_lfwrite ("#{", 2, port); weird = 1; } if (pos < end) { - scm_gen_write (scm_regular_string, str + pos, end - pos, port); + scm_lfwrite (str + pos, end - pos, port); } { char buf[2]; buf[0] = '\\'; buf[1] = str[end]; - scm_gen_write (scm_regular_string, buf, 2, port); + scm_lfwrite (buf, 2, port); } pos = end + 1; break; @@ -542,22 +538,22 @@ taloop: break; } if (pos < end) - scm_gen_write (scm_regular_string, str + pos, end - pos, port); + scm_lfwrite (str + pos, end - pos, port); if (weird) - scm_gen_write (scm_regular_string, "}#", 2, port); + scm_lfwrite ("}#", 2, port); break; } case scm_tc7_wvect: ENTER_NESTED_DATA (pstate, exp, circref); if (SCM_IS_WHVEC (exp)) - scm_gen_puts (scm_regular_string, "#wh(", port); + scm_puts ("#wh(", port); else - scm_gen_puts (scm_regular_string, "#w(", port); + scm_puts ("#w(", port); goto common_vector_printer; case scm_tc7_vector: ENTER_NESTED_DATA (pstate, exp, circref); - scm_gen_puts (scm_regular_string, "#(", port); + scm_puts ("#(", port); common_vector_printer: { int last = SCM_LENGTH (exp) - 1; @@ -571,7 +567,7 @@ taloop: { /* CHECK_INTS; */ scm_iprin1 (SCM_VELTS (exp)[i], port, pstate); - scm_gen_putc (' ', port); + scm_putc (' ', port); } if (i == last) { @@ -579,8 +575,8 @@ taloop: scm_iprin1 (SCM_VELTS (exp)[i], port, pstate); } if (cutp) - scm_gen_puts (scm_regular_string, " ...", port); - scm_gen_putc (')', port); + scm_puts (" ...", port); + scm_putc (')', port); } EXIT_NESTED_DATA (pstate); break; @@ -598,26 +594,23 @@ taloop: scm_raprin1 (exp, port, pstate); break; case scm_tcs_subrs: - scm_gen_puts (scm_regular_string, "#', port); + scm_puts ("#', port); break; #ifdef CCLO case scm_tc7_cclo: - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); break; #endif case scm_tc7_contin: - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); break; case scm_tc7_port: i = SCM_PTOBNUM (exp); @@ -718,7 +711,7 @@ scm_intprint (n, radix, port) SCM port; { char num_buf[SCM_INTBUFLEN]; - scm_gen_write (scm_regular_string, num_buf, scm_iint2str (n, radix, num_buf), port); + scm_lfwrite (num_buf, scm_iint2str (n, radix, num_buf), port); } /* Print an object of unrecognized type. @@ -730,19 +723,19 @@ scm_ipruk (hdr, ptr, port) SCM ptr; SCM port; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); } /* Print a list. @@ -760,7 +753,7 @@ scm_iprlist (hdr, exp, tlr, port, pstate) register int i; register SCM hare, tortoise; int floor = pstate->top - 2; - scm_gen_puts (scm_regular_string, hdr, port); + scm_puts (hdr, port); /* CHECK_INTS; */ if (pstate->fancyp) goto fancy_printing; @@ -791,18 +784,18 @@ scm_iprlist (hdr, exp, tlr, port, pstate) if (pstate->ref_stack[i] == exp) goto circref; PUSH_REF (pstate, exp); - scm_gen_putc (' ', port); + scm_putc (' ', port); /* CHECK_INTS; */ scm_iprin1 (SCM_CAR (exp), port, pstate); } if (SCM_NNULLP (exp)) { - scm_gen_puts (scm_regular_string, " . ", port); + scm_puts (" . ", port); scm_iprin1 (exp, port, pstate); } end: - scm_gen_putc (tlr, port); + scm_putc (tlr, port); pstate->top = floor + 2; return; @@ -823,7 +816,7 @@ fancy_printing: { if (n == 0) { - scm_gen_puts (scm_regular_string, " ...", port); + scm_puts (" ...", port); goto skip_tail; } else @@ -831,14 +824,14 @@ fancy_printing: } PUSH_REF(pstate, exp); ++pstate->list_offset; - scm_gen_putc (' ', port); + scm_putc (' ', port); /* CHECK_INTS; */ scm_iprin1 (SCM_CAR (exp), port, pstate); } } if (SCM_NNULLP (exp)) { - scm_gen_puts (scm_regular_string, " . ", port); + scm_puts (" . ", port); scm_iprin1 (exp, port, pstate); } skip_tail: @@ -849,7 +842,7 @@ fancy_circref: pstate->list_offset -= pstate->top - floor - 2; circref: - scm_gen_puts (scm_regular_string, " . ", port); + scm_puts (" . ", port); print_circref (port, pstate, exp); goto end; } @@ -924,7 +917,7 @@ scm_newline (port) else SCM_ASSERT (scm_valid_oport_value_p (port), port, SCM_ARG1, s_newline); - scm_gen_putc ('\n', SCM_COERCE_OPORT (port)); + scm_putc ('\n', SCM_COERCE_OPORT (port)); #ifdef HAVE_PIPE # ifdef EPIPE if (EPIPE == errno) @@ -950,7 +943,7 @@ scm_write_char (chr, port) SCM_ASSERT (scm_valid_oport_value_p (port), port, SCM_ARG2, s_write_char); SCM_ASSERT (SCM_ICHRP (chr), chr, SCM_ARG1, s_write_char); - scm_gen_putc ((int) SCM_ICHR (chr), SCM_COERCE_OPORT (port)); + scm_putc ((int) SCM_ICHR (chr), SCM_COERCE_OPORT (port)); #ifdef HAVE_PIPE # ifdef EPIPE if (EPIPE == errno) diff --git a/libguile/read.c b/libguile/read.c index c45c91388..e6ff1361a 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -40,14 +40,12 @@ * If you do not wish that, delete this exception notice. */ -#include "extchrs.h" #include #include "_scm.h" #include "chars.h" #include "genio.h" #include "eval.h" #include "unif.h" -#include "mbstrings.h" #include "kw.h" #include "alist.h" #include "srcprop.h" @@ -109,7 +107,7 @@ scm_read (port) c = scm_flush_ws (port, (char *) NULL); if (EOF == c) return SCM_EOF_VAL; - scm_gen_ungetc (c, port); + scm_ungetc (c, port); tok_buf = scm_makstr (30L, 0); return scm_lreadr (&tok_buf, port, ©); @@ -134,7 +132,7 @@ scm_flush_ws (port, eoferr) { register int c; while (1) - switch (c = scm_gen_getc (port)) + switch (c = scm_getc (port)) { case EOF: goteof: @@ -143,7 +141,7 @@ scm_flush_ws (port, eoferr) return c; case ';': lp: - switch (c = scm_gen_getc (port)) + switch (c = scm_getc (port)) { case EOF: goto goteof; @@ -254,7 +252,7 @@ skip_scsh_block_comment (port) for (;;) { - int c = scm_gen_getc (port); + int c = scm_getc (port); if (c == EOF) scm_wta (SCM_UNDEFINED, @@ -305,12 +303,12 @@ tryagain_no_flush_ws: p = scm_i_quasiquote; goto recquote; case ',': - c = scm_gen_getc (port); + c = scm_getc (port); if ('@' == c) p = scm_i_uq_splicing; else { - scm_gen_ungetc (c, port); + scm_ungetc (c, port); p = scm_i_unquote; } recquote: @@ -331,7 +329,7 @@ tryagain_no_flush_ws: SCM_EOL)); return p; case '#': - c = scm_gen_getc (port); + c = scm_getc (port); switch (c) { case '(': @@ -357,7 +355,7 @@ tryagain_no_flush_ws: case 'I': case 'e': case 'E': - scm_gen_ungetc (c, port); + scm_ungetc (c, port); c = '#'; goto num; @@ -380,12 +378,10 @@ tryagain_no_flush_ws: case '{': j = scm_read_token (c, tok_buf, port, 1); p = scm_intern (SCM_CHARS (*tok_buf), j); - if (SCM_PORT_REPRESENTATION (port) != scm_regular_port) - scm_set_symbol_multi_byte_x (SCM_CAR (p), SCM_BOOL_T); return SCM_CAR (p); case '\\': - c = scm_gen_getc (port); + c = scm_getc (port); j = scm_read_token (c, tok_buf, port, 0); if (j == 1) return SCM_MAKICHR (c); @@ -405,8 +401,6 @@ tryagain_no_flush_ws: case ':': j = scm_read_token ('-', tok_buf, port, 0); p = scm_intern (SCM_CHARS (*tok_buf), j); - if (SCM_PORT_REPRESENTATION (port) != scm_regular_port) - scm_set_symbol_multi_byte_x (SCM_CAR (p), SCM_BOOL_T); return scm_make_keyword_from_dash_symbol (SCM_CAR (p)); default: @@ -439,15 +433,15 @@ tryagain_no_flush_ws: case '"': j = 0; - while ('"' != (c = scm_gen_getc (port))) + while ('"' != (c = scm_getc (port))) { SCM_ASSERT (EOF != c, SCM_UNDEFINED, "end of file in ", "string"); - while (j + sizeof(xwchar_t) + XMB_CUR_MAX >= SCM_LENGTH (*tok_buf)) + while (j + 2 >= SCM_LENGTH (*tok_buf)) scm_grow_tok_buf (tok_buf); if (c == '\\') - switch (c = scm_gen_getc (port)) + switch (c = scm_getc (port)) { case '\n': continue; @@ -473,20 +467,8 @@ tryagain_no_flush_ws: c = '\v'; break; } - if (SCM_PORT_REPRESENTATION(port) == scm_regular_port) - { - SCM_CHARS (*tok_buf)[j] = c; - ++j; - } - else - { - int len; - len = xwctomb (SCM_CHARS (*tok_buf) + j, c); - if (len == 0) - len = 1; - SCM_ASSERT (len > 0, SCM_MAKINUM (c), "bogus char", "read"); - j += len; - } + SCM_CHARS (*tok_buf)[j] = c; + ++j; } if (j == 0) return scm_nullstr; @@ -494,10 +476,6 @@ tryagain_no_flush_ws: { SCM str; str = scm_makfromstr (SCM_CHARS (*tok_buf), j, 0); - if (SCM_PORT_REPRESENTATION(port) != scm_regular_port) - { - SCM_SETLENGTH (str, SCM_LENGTH (str), scm_tc7_mb_string); - } return str; } @@ -513,9 +491,9 @@ tryagain_no_flush_ws: return p; if (c == '#') { - if ((j == 2) && (scm_gen_getc (port) == '(')) + if ((j == 2) && (scm_getc (port) == '(')) { - scm_gen_ungetc ('(', port); + scm_ungetc ('(', port); c = SCM_CHARS (*tok_buf)[1]; goto callshrp; } @@ -528,8 +506,6 @@ tryagain_no_flush_ws: { j = scm_read_token ('-', tok_buf, port, 0); p = scm_intern (SCM_CHARS (*tok_buf), j); - if (SCM_PORT_REPRESENTATION (port) != scm_regular_port) - scm_set_symbol_multi_byte_x (SCM_CAR (p), SCM_BOOL_T); return scm_make_keyword_from_dash_symbol (SCM_CAR (p)); } /* fallthrough */ @@ -539,8 +515,6 @@ tryagain_no_flush_ws: tok: p = scm_intern (SCM_CHARS (*tok_buf), j); - if (SCM_PORT_REPRESENTATION (port) != scm_regular_port) - scm_set_symbol_multi_byte_x (SCM_CAR (p), SCM_BOOL_T); return SCM_CAR (p); } } @@ -568,29 +542,17 @@ scm_read_token (ic, tok_buf, port, weird) else { j = 0; - while (j + sizeof(xwchar_t) + XMB_CUR_MAX >= SCM_LENGTH (*tok_buf)) + while (j + 2 >= SCM_LENGTH (*tok_buf)) p = scm_grow_tok_buf (tok_buf); - if (SCM_PORT_REPRESENTATION(port) == scm_regular_port) - { - p[j] = c; - ++j; - } - else - { - int len; - len = xwctomb (p + j, c); - if (len == 0) - len = 1; - SCM_ASSERT (len > 0, SCM_MAKINUM (c), "bogus char", "read"); - j += len; - } + p[j] = c; + ++j; } while (1) { - while (j + sizeof(xwchar_t) + XMB_CUR_MAX >= SCM_LENGTH (*tok_buf)) + while (j + 2 >= SCM_LENGTH (*tok_buf)) p = scm_grow_tok_buf (tok_buf); - c = scm_gen_getc (port); + c = scm_getc (port); switch (c) { case '(': @@ -602,7 +564,7 @@ scm_read_token (ic, tok_buf, port, weird) if (weird) goto default_case; - scm_gen_ungetc (c, port); + scm_ungetc (c, port); case EOF: eof_case: p[j] = 0; @@ -612,7 +574,7 @@ scm_read_token (ic, tok_buf, port, weird) goto default_case; else { - c = scm_gen_getc (port); + c = scm_getc (port); if (c == EOF) goto eof_case; else @@ -622,7 +584,7 @@ scm_read_token (ic, tok_buf, port, weird) if (!weird) goto default_case; - c = scm_gen_getc (port); + c = scm_getc (port); if (c == '#') { p[j] = 0; @@ -630,7 +592,7 @@ scm_read_token (ic, tok_buf, port, weird) } else { - scm_gen_ungetc (c, port); + scm_ungetc (c, port); c = '}'; goto default_case; } @@ -639,20 +601,8 @@ scm_read_token (ic, tok_buf, port, weird) default_case: { c = (SCM_CASE_INSENSITIVE_P ? scm_downcase(c) : c); - if (SCM_PORT_REPRESENTATION(port) == scm_regular_port) - { - p[j] = c; - ++j; - } - else - { - int len; - len = xwctomb (p + j, c); - if (len == 0) - len = 1; - SCM_ASSERT (len > 0, SCM_MAKINUM (c), "bogus char", "read"); - j += len; - } + p[j] = c; + ++j; } } @@ -678,7 +628,7 @@ scm_lreadparen (tok_buf, port, name, copy) c = scm_flush_ws (port, name); if (')' == c) return SCM_EOL; - scm_gen_ungetc (c, port); + scm_ungetc (c, port); if (scm_i_dot == (tmp = scm_lreadr (tok_buf, port, copy))) { ans = scm_lreadr (tok_buf, port, copy); @@ -690,7 +640,7 @@ scm_lreadparen (tok_buf, port, name, copy) ans = tl = scm_cons (tmp, SCM_EOL); while (')' != (c = scm_flush_ws (port, name))) { - scm_gen_ungetc (c, port); + scm_ungetc (c, port); if (scm_i_dot == (tmp = scm_lreadr (tok_buf, port, copy))) { SCM_SETCDR (tl, scm_lreadr (tok_buf, port, copy)); @@ -721,7 +671,7 @@ scm_lreadrecparen (tok_buf, port, name, copy) c = scm_flush_ws (port, name); if (')' == c) return SCM_EOL; - scm_gen_ungetc (c, port); + scm_ungetc (c, port); if (scm_i_dot == (tmp = scm_lreadr (tok_buf, port, copy))) { ans = scm_lreadr (tok_buf, port, copy); @@ -738,7 +688,7 @@ scm_lreadrecparen (tok_buf, port, name, copy) SCM_EOL); while (')' != (c = scm_flush_ws (port, name))) { - scm_gen_ungetc (c, port); + scm_ungetc (c, port); if (scm_i_dot == (tmp = scm_lreadr (tok_buf, port, copy))) { SCM_SETCDR (tl, tmp = scm_lreadr (tok_buf, port, copy)); diff --git a/libguile/regex-posix.c b/libguile/regex-posix.c index e941393d0..c6ffd3862 100644 --- a/libguile/regex-posix.c +++ b/libguile/regex-posix.c @@ -104,9 +104,9 @@ scm_print_regex_t (obj, port, pstate) { regex_t *r; r = SCM_RGX (obj); - scm_gen_puts (scm_regular_string, "#", port); + scm_puts (">", port); return 1; } diff --git a/libguile/root.c b/libguile/root.c index 0fa904688..291de56d8 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -115,9 +115,9 @@ print_root (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "# rootcont), 16, port); - scm_gen_putc('>', port); + scm_putc('>', port); return 1; } diff --git a/libguile/srcprop.c b/libguile/srcprop.c index d52cb3a24..733c3b26b 100644 --- a/libguile/srcprop.c +++ b/libguile/srcprop.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation +/* Copyright (C) 1995,1996, 1997 Free Software Foundation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -114,11 +114,11 @@ prinsrcprops (obj, port, pstate) scm_print_state *pstate; { int writingp = SCM_WRITINGP (pstate); - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return 1; } diff --git a/libguile/stackchk.c b/libguile/stackchk.c index 4645db4be..8134878b7 100644 --- a/libguile/stackchk.c +++ b/libguile/stackchk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -87,11 +87,11 @@ scm_stack_report () SCM_STACKITEM stack; scm_intprint (scm_stack_size (SCM_BASE (scm_rootcont)) * sizeof (SCM_STACKITEM), 16, scm_cur_errp); - scm_gen_puts (scm_regular_string, " of stack: 0x", scm_cur_errp); + scm_puts (" of stack: 0x", scm_cur_errp); scm_intprint ((long) SCM_BASE (scm_rootcont), 16, scm_cur_errp); - scm_gen_puts (scm_regular_string, " - 0x", scm_cur_errp); + scm_puts (" - 0x", scm_cur_errp); scm_intprint ((long) &stack, 16, scm_cur_errp); - scm_gen_puts (scm_regular_string, "\n", scm_cur_errp); + scm_puts ("\n", scm_cur_errp); } diff --git a/libguile/strop.c b/libguile/strop.c index 92d134e33..57eef7ef5 100644 --- a/libguile/strop.c +++ b/libguile/strop.c @@ -257,7 +257,6 @@ SCM scm_string_copy (str) SCM str; { - /* doesn't handle multibyte strings. */ SCM_ASSERT (SCM_NIMP (str) && (SCM_STRINGP (str) || SCM_SUBSTRP (str)), str, SCM_ARG1, s_string_copy); return scm_makfromstr (SCM_ROCHARS (str), (scm_sizet)SCM_ROLENGTH (str), 0); diff --git a/libguile/struct.c b/libguile/struct.c index b3f0ef74c..a6931351d 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -607,12 +607,11 @@ scm_print_struct (exp, port, pstate) scm_printer_apply (SCM_STRUCT_PRINTER (exp), exp, port, pstate); else { - scm_gen_write (scm_regular_string, "#', port); + scm_putc ('>', port); } } diff --git a/libguile/symbols.c b/libguile/symbols.c index 5d10faf14..8f291788c 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -46,7 +46,6 @@ #include "eval.h" #include "variable.h" #include "alist.h" -#include "mbstrings.h" #include "weaks.h" #include "symbols.h" @@ -298,7 +297,6 @@ scm_intern_obarray_soft (name, len, obarray, softness) lsym = scm_makfromstr (name, len, SCM_SYMBOL_SLOTS); SCM_SETLENGTH (lsym, (long) len, scm_tc7_msymbol); - SCM_SYMBOL_MULTI_BYTE_STRINGP (lsym) = SCM_BOOL_F; SCM_SYMBOL_HASH (lsym) = scm_hash; SCM_SYMBOL_PROPS (lsym) = SCM_EOL; if (obarray == SCM_BOOL_F) @@ -474,13 +472,6 @@ scm_string_to_symbol(s) SCM_ASSERT(SCM_NIMP(s) && SCM_ROSTRINGP(s), s, SCM_ARG1, s_string_to_symbol); vcell = scm_intern(SCM_ROCHARS(s), (scm_sizet)SCM_LENGTH(s)); answer = SCM_CAR (vcell); - if (SCM_TYP7 (answer) == scm_tc7_msymbol) - { - if (SCM_REGULAR_STRINGP (s)) - SCM_SYMBOL_MULTI_BYTE_STRINGP (answer) = SCM_BOOL_F; - else - SCM_SYMBOL_MULTI_BYTE_STRINGP (answer) = SCM_BOOL_T; - } return answer; } @@ -520,13 +511,6 @@ scm_string_to_obarray_symbol(o, s, softp) if (vcell == SCM_BOOL_F) return vcell; answer = SCM_CAR (vcell); - if (SCM_TYP7 (s) == scm_tc7_msymbol) - { - if (SCM_REGULAR_STRINGP (s)) - SCM_SYMBOL_MULTI_BYTE_STRINGP (answer) = SCM_BOOL_F; - else - SCM_SYMBOL_MULTI_BYTE_STRINGP (answer) = SCM_BOOL_T; - } return answer; } @@ -689,7 +673,6 @@ msymbolize (s) string = scm_makfromstr (SCM_CHARS (s), SCM_LENGTH (s), SCM_SYMBOL_SLOTS); SCM_SETCHARS (s, SCM_CHARS (string)); SCM_SETLENGTH (s, SCM_LENGTH (s), scm_tc7_msymbol); - SCM_SYMBOL_MULTI_BYTE_STRINGP (s) = SCM_BOOL_F; SCM_SETCDR (string, SCM_EOL); SCM_SETCAR (string, SCM_EOL); SCM_SYMBOL_PROPS (s) = SCM_EOL; diff --git a/libguile/symbols.h b/libguile/symbols.h index c2ced2616..6f335c2c5 100644 --- a/libguile/symbols.h +++ b/libguile/symbols.h @@ -59,9 +59,8 @@ extern int scm_symhash_dim; and that's it. They use the scm_tc7_ssymbol tag (S bit clear). Msymbols are symbols with extra slots. These slots hold a property - list and a function value (for Emacs Lisp compatibility), a hash - code, and a flag to indicate whether their name contains multibyte - characters. They use the scm_tc7_msymbol tag. + list and a function value (for Emacs Lisp compatibility), and a hash + code. They use the scm_tc7_msymbol tag. We'd like SCM_CHARS to work on msymbols just as it does on ssymbols, so we'll have it point to the symbol's name as usual, and @@ -82,13 +81,12 @@ extern int scm_symhash_dim; #define SCM_CHARS(x) ((char *)(SCM_CDR(x))) #define SCM_UCHARS(x) ((unsigned char *)(SCM_CDR(x))) #define SCM_SLOTS(x) ((SCM *) (* ((SCM *)SCM_CHARS(x) - 1))) -#define SCM_SYMBOL_SLOTS 5 +#define SCM_SYMBOL_SLOTS 4 #define SCM_SYMBOL_FUNC(X) (SCM_SLOTS(X)[0]) #define SCM_SYMBOL_PROPS(X) (SCM_SLOTS(X)[1]) #define SCM_SYMBOL_HASH(X) (*(unsigned long*)(&SCM_SLOTS(X)[2])) -#define SCM_SYMBOL_MULTI_BYTE_STRINGP(X) (*(unsigned long*)(&SCM_SLOTS(X)[3])) -#define SCM_ROSTRINGP(x) ((SCM_TYP7SD(x)==scm_tc7_string) || (SCM_TYP7S(x) == scm_tc7_ssymbol)) +#define SCM_ROSTRINGP(x) ((SCM_TYP7S(x)==scm_tc7_string) || (SCM_TYP7S(x) == scm_tc7_ssymbol)) #define SCM_ROCHARS(x) ((SCM_TYP7(x) == scm_tc7_substring) \ ? SCM_INUM (SCM_CADR (x)) + SCM_CHARS (SCM_CDDR (x)) \ : SCM_CHARS (x)) diff --git a/libguile/tag.c b/libguile/tag.c index ec020c6cc..4e8ce4a2c 100644 --- a/libguile/tag.c +++ b/libguile/tag.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,9 +63,7 @@ SCM_CONST_LONG (scm_utag_fvect, "utag_fvect", 12); SCM_CONST_LONG (scm_utag_dvect, "utag_dvect", 13); SCM_CONST_LONG (scm_utag_cvect, "utag_cvect", 14); SCM_CONST_LONG (scm_utag_string, "utag_string", 15); -SCM_CONST_LONG (scm_utag_mb_string, "utag_mb_string", 16); SCM_CONST_LONG (scm_utag_substring, "utag_substring", 17); -SCM_CONST_LONG (scm_utag_mb_substring, "utag_mb_substring", 18); SCM_CONST_LONG (scm_utag_asubr, "utag_asubr", 19); SCM_CONST_LONG (scm_utag_subr_0, "utag_subr_0", 20); SCM_CONST_LONG (scm_utag_subr_1, "utag_subr_1", 21); @@ -136,12 +134,8 @@ scm_tag (x) return SCM_CDR (scm_utag_cvect) ; case scm_tc7_string: return SCM_CDR (scm_utag_string) ; - case scm_tc7_mb_string: - return SCM_CDR (scm_utag_mb_string) ; case scm_tc7_substring: return SCM_CDR (scm_utag_substring) ; - case scm_tc7_mb_substring: - return SCM_CDR (scm_utag_mb_substring) ; case scm_tc7_asubr: return SCM_CDR (scm_utag_asubr) ; case scm_tc7_subr_0: diff --git a/libguile/tags.h b/libguile/tags.h index 4f428500e..38aa1cda4 100644 --- a/libguile/tags.h +++ b/libguile/tags.h @@ -2,7 +2,7 @@ #ifndef TAGSH #define TAGSH -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -218,31 +218,20 @@ typedef long SCM; * bits) can be masked off to reveal a common type. * * TYP7S(X) returns TYP7, but masking out the option bit S. - * TYP7D(X) returns TYP7, but masking out the option bit D. - * TYP7SD(X) masks out both option bits. * * For example, all strings have 001 in the 'xxx' bits in * the diagram above, the D bit says whether it's a - * substring, and the S bit says whether it's a multibyte - * character string. + * substring. * * for example: - * D S + * S * scm_tc7_string = G0010101 - * scm_tc7_mb_string = G0010111 * scm_tc7_substring = G0011101 - * scm_tc7_mb_substring = G0011111 * - * TYP7DS turns all string tags into tc7_string; thus, - * testing TYP7DS against tc7_string is a quick way to + * TYP7S turns all string tags into tc7_string; thus, + * testing TYP7S against tc7_string is a quick way to * test for any kind of string. * - * TYP7S turns tc7_mb_string into tc7_string and - * tc7_mb_substring into tc7_substring. - * - * TYP7D turns tc7_mb_substring into tc7_mb_string and - * tc7_substring into tc7_string. - * * Some TC7 types are subdivided into 256 subtypes giving * rise to the macros: * @@ -312,8 +301,6 @@ typedef long SCM; #define SCM_TYP7(x) (0x7f & (int)SCM_CAR(x)) #define SCM_TYP7S(x) (0x7d & (int)SCM_CAR(x)) -#define SCM_TYP7SD(x) (0x75 & (int)SCM_CAR(x)) -#define SCM_TYP7D(x) (0x77 & (int)SCM_CAR(x)) #define SCM_TYP16(x) (0xffff & (int)SCM_CAR(x)) @@ -344,9 +331,7 @@ typedef long SCM; /* a quad, two couples, two trists */ #define scm_tc7_string 21 -#define scm_tc7_mb_string 23 #define scm_tc7_substring 29 -#define scm_tc7_mb_substring 31 /* Many of the following should be turned * into structs or smobs. We need back some diff --git a/libguile/threads.c b/libguile/threads.c index b540f51b1..11fb87f99 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -87,9 +87,9 @@ print_thread (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return 1; } @@ -107,9 +107,9 @@ print_mutex (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return 1; } @@ -127,9 +127,9 @@ print_condvar (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return 1; } diff --git a/libguile/throw.c b/libguile/throw.c index 3ad4d866e..b83b78f5d 100644 --- a/libguile/throw.c +++ b/libguile/throw.c @@ -94,10 +94,10 @@ printjb (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc ('>', port); return 1 ; } @@ -273,7 +273,7 @@ print_lazy_catch (SCM closure, SCM port, scm_print_state *pstate) sprintf (buf, "#", (long) c->handler, (long) c->handler_data); - scm_gen_puts (scm_regular_string, buf, port); + scm_puts (buf, port); return 1; } @@ -489,8 +489,8 @@ handler_message (void *handler_data, SCM tag, SCM args) if (! prog_name) prog_name = "guile"; - scm_gen_puts (scm_regular_string, prog_name, p); - scm_gen_puts (scm_regular_string, ": ", p); + scm_puts (prog_name, p); + scm_puts (": ", p); if (scm_ilength (args) >= 3) { @@ -501,11 +501,11 @@ handler_message (void *handler_data, SCM tag, SCM args) } else { - scm_gen_puts (scm_regular_string, "uncaught throw to ", p); + scm_puts ("uncaught throw to ", p); scm_prin1 (tag, p, 0); - scm_gen_puts (scm_regular_string, ": ", p); + scm_puts (": ", p); scm_prin1 (args, p, 1); - scm_gen_putc ('\n', p); + scm_putc ('\n', p); } } diff --git a/libguile/unif.c b/libguile/unif.c index 17b5fbd7a..d6bf1da80 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -99,7 +99,6 @@ scm_vector_set_length_x (vect, len) default: badarg1: scm_wta (vect, (char *) SCM_ARG1, s_vector_set_length_x); case scm_tc7_string: - case scm_tc7_mb_string: SCM_ASRTGO (vect != scm_nullstr, badarg1); sz = sizeof (char); l++; @@ -2228,7 +2227,7 @@ tail: scm_iprin1 (ra, port, pstate); for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); SCM_ARRAY_BASE (ra) = j; scm_iprin1 (ra, port, pstate); } @@ -2240,16 +2239,16 @@ tail: inc = SCM_ARRAY_DIMS (ra)[k].inc; for (i = SCM_ARRAY_DIMS (ra)[k].lbnd; i < SCM_ARRAY_DIMS (ra)[k].ubnd; i++) { - scm_gen_putc ('(', port); + scm_putc ('(', port); rapr1 (ra, j, k + 1, port, pstate); - scm_gen_puts (scm_regular_string, ") ", port); + scm_puts (") ", port); j += inc; } if (i == SCM_ARRAY_DIMS (ra)[k].ubnd) { /* could be zero size. */ - scm_gen_putc ('(', port); + scm_putc ('(', port); rapr1 (ra, j, k + 1, port, pstate); - scm_gen_putc (')', port); + scm_putc (')', port); } break; } @@ -2268,7 +2267,7 @@ tail: scm_iprin1 (scm_uniform_vector_ref (ra, SCM_MAKINUM (j)), port, pstate); for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); scm_iprin1 (scm_cvref (ra, j, SCM_UNDEFINED), port, pstate); } break; @@ -2278,19 +2277,19 @@ tail: if (SCM_WRITINGP (pstate)) for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); scm_iprin1 (SCM_MAKICHR (SCM_CHARS (ra)[j]), port, pstate); } else for (j += inc; n-- > 0; j += inc) - scm_gen_putc (SCM_CHARS (ra)[j], port); + scm_putc (SCM_CHARS (ra)[j], port); break; case scm_tc7_byvect: if (n-- > 0) scm_intprint (((char *)SCM_CDR (ra))[j], 10, port); for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); scm_intprint (((char *)SCM_CDR (ra))[j], 10, port); } break; @@ -2301,7 +2300,7 @@ tail: scm_intprint (SCM_VELTS (ra)[j], 10, port); for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); scm_intprint (SCM_VELTS (ra)[j], 10, port); } break; @@ -2311,7 +2310,7 @@ tail: scm_intprint (((short *)SCM_CDR (ra))[j], 10, port); for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); scm_intprint (((short *)SCM_CDR (ra))[j], 10, port); } break; @@ -2326,7 +2325,7 @@ tail: scm_floprint (z, port, pstate); for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); SCM_FLO (z) = ((float *) SCM_VELTS (ra))[j]; scm_floprint (z, port, pstate); } @@ -2341,7 +2340,7 @@ tail: scm_floprint (z, port, pstate); for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); SCM_REAL (z) = ((double *) SCM_VELTS (ra))[j]; scm_floprint (z, port, pstate); } @@ -2356,7 +2355,7 @@ tail: scm_floprint ((0.0 == SCM_IMAG (cz) ? z : cz), port, pstate); for (j += inc; n-- > 0; j += inc) { - scm_gen_putc (' ', port); + scm_putc (' ', port); SCM_REAL (z) = SCM_REAL (cz) = ((double *) SCM_VELTS (ra))[2 * j]; SCM_IMAG (cz) = ((double *) SCM_VELTS (ra))[2 * j + 1]; scm_floprint ((0.0 == SCM_IMAG (cz) ? z : cz), port, pstate); @@ -2377,7 +2376,7 @@ scm_raprin1 (exp, port, pstate) { SCM v = exp; scm_sizet base = 0; - scm_gen_putc ('#', port); + scm_putc ('#', port); tail: switch SCM_TYP7 (v) @@ -2390,9 +2389,9 @@ tail: if (SCM_ARRAYP (v)) { - scm_gen_puts (scm_regular_string, "', port); + scm_putc ('>', port); return 1; } else @@ -2405,13 +2404,13 @@ tail: if (exp == v) { /* a uve, not an scm_array */ register long i, j, w; - scm_gen_putc ('*', port); + scm_putc ('*', port); for (i = 0; i < (SCM_LENGTH (exp)) / SCM_LONG_BIT; i++) { w = SCM_VELTS (exp)[i]; for (j = SCM_LONG_BIT; j; j--) { - scm_gen_putc (w & 1 ? '1' : '0', port); + scm_putc (w & 1 ? '1' : '0', port); w >>= 1; } } @@ -2421,52 +2420,52 @@ tail: w = SCM_VELTS (exp)[SCM_LENGTH (exp) / SCM_LONG_BIT]; for (; j; j--) { - scm_gen_putc (w & 1 ? '1' : '0', port); + scm_putc (w & 1 ? '1' : '0', port); w >>= 1; } } return 1; } else - scm_gen_putc ('b', port); + scm_putc ('b', port); break; case scm_tc7_string: - scm_gen_putc ('a', port); + scm_putc ('a', port); break; case scm_tc7_byvect: - scm_gen_puts (scm_regular_string, "bytes", port); + scm_puts ("bytes", port); break; case scm_tc7_uvect: - scm_gen_putc ('u', port); + scm_putc ('u', port); break; case scm_tc7_ivect: - scm_gen_putc ('e', port); + scm_putc ('e', port); break; case scm_tc7_svect: - scm_gen_puts (scm_regular_string, "short", port); + scm_puts ("short", port); break; #ifdef LONGLONGS case scm_tc7_llvect: - scm_gen_puts (scm_regular_string, "long_long", port); + scm_puts ("long_long", port); break; #endif #ifdef SCM_FLOATS #ifdef SCM_SINGLES case scm_tc7_fvect: - scm_gen_putc ('s', port); + scm_putc ('s', port); break; #endif /*SCM_SINGLES*/ case scm_tc7_dvect: - scm_gen_putc ('i', port); + scm_putc ('i', port); break; case scm_tc7_cvect: - scm_gen_putc ('c', port); + scm_putc ('c', port); break; #endif /*SCM_FLOATS*/ } - scm_gen_putc ('(', port); + scm_putc ('(', port); rapr1 (exp, base, 0, port, pstate); - scm_gen_putc (')', port); + scm_putc (')', port); return 1; } diff --git a/libguile/variable.c b/libguile/variable.c index 5d64bab4a..02f9a5caa 100644 --- a/libguile/variable.c +++ b/libguile/variable.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,20 +68,20 @@ prin_var (exp, port, pstate) SCM port; scm_print_state *pstate; { - scm_gen_puts (scm_regular_string, "#', port); + scm_putc('>', port); return 1; } -- 2.20.1