1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
Commit graph

17820 commits

Author SHA1 Message Date
Andy Wingo
8af64975be Make file/line/column fields of ports private
* libguile/ports-internal.h (scm_t_port_internal): Move file_name,
  line_number, and column_number here.
  (SCM_FILENAME, SCM_SET_FILENAME, SCM_LINUM, SCM_COL, SCM_INCLINE):
  (SCM_ZEROCOL, SCM_INCCOL, SCM_DECCOL, SCM_TABCOL): Make internal.
* libguile/ports.c (scm_c_make_port_with_encoding)
  (scm_set_port_line_x, scm_set_port_column_x): Adapt to change.
2016-05-13 10:33:17 +02:00
Andy Wingo
209d50c7d8 Embed scm_t_port in scm_t_port_internal
* libguile/ports-internal.h (scm_t_port_internal)
* libguile/ports.h (scm_t_port): Embed scm_t_port in scm_t_port_internal
  so that we have just one allocation.
* libguile/ports-internal.h (SCM_PORT_GET_INTERNAL): Adapt.
* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x)
  (scm_c_make_port_with_encoding): Adapt.
2016-05-13 10:24:32 +02:00
Andy Wingo
fe7ceff969 Remove SCM backlink in port structure
* libguile/ports.h (scm_t_port): Remove port backlink.
* libguile/ports.c (scm_c_make_port_with_encoding, scm_fill_input)
  (scm_seek): Adapt.
2016-05-13 10:16:27 +02:00
Andy Wingo
6ff542ee71 Add random_access_p port type method
* doc/ref/api-io.texi (I/O Extensions): Update documentation on
  implementing port types.  Document get_natural_buffer_sizes.  Document
  the new random_access_p.
* libguile/fports.c (scm_i_fdes_to_port, fport_random_access_p):
  (scm_make_fptob): Instead of frobbing rw_random manually, implement a
  random_access_p function.
* libguile/ports.c (default_random_access_p)
  (scm_set_port_random_access_p): New functions.
  scm_make_port_type, scm_c_make_port_with_encoding): Arrange for
  random_access_p to work.
2016-05-13 10:05:23 +02:00
Andy Wingo
704c42870d Add (ice-9 sports) module
* module/ice-9/sports.scm: New module.
* module/Makefile.am (SOURCES): Add new module.
2016-05-13 09:22:36 +02:00
Andy Wingo
d1bb400c3f Beginnings of shunting ports-in-scheme off to a module
* libguile/ports.c (scm_specialize_port_encoding_x): Add some sanity
  checks.
  (scm_unget_bytes): Use scm_expand_port_read_buffer_x.
  (port_clear_stream_start_for_bom_read): Use
  scm_specialize_port_encoding_x.
  (scm_fill_input): Use scm_expand_port_read_buffer_x.
  (scm_expand_port_read_buffer_x): Rename from
  scm_set_port_read_buffer_x and actually expand the buffer.
* libguile/ports.h: Adapt to scm_expand_port_read_buffer_x change.

* module/ice-9/ports.scm: Remove ports-in-scheme stuff, and instead
  expose the ports internals via an auxiliary module.  This will let
  ports-in-scheme live in a module during Guile 2.2.
2016-05-13 09:09:42 +02:00
Andy Wingo
df0dade9b7 Implement lookahead-u8, get-u8 in Scheme
* module/ice-9/ports.scm (%lookahead-u8, %get-u8): Scheme
  implementations.
2016-05-12 08:57:01 +02:00
Andy Wingo
a8fe0f42f3 %read-char speedup
* module/ice-9/ports.scm (%read-char): Always call update-position! with
  the same continuation, so that it will contify.
2016-05-10 16:30:50 +02:00
Andy Wingo
d28d1a57bf Implement read-char in Scheme.
* module/ice-9/ports.scm (%read-char): New function.
2016-05-10 15:38:30 +02:00
Andy Wingo
ab21af544a %peek-char port argument optional.
* module/ice-9/ports.scm (%peek-char): Port argument is optional.
2016-05-10 15:38:11 +02:00
Andy Wingo
3ccfa213c1 peek-char-and-len/iconv uses both returns from fill-input
* module/ice-9/ports.scm (peek-char-and-len/iconv): Use buffered value
  from fill-input.
2016-05-10 15:37:42 +02:00
Andy Wingo
9c02ede07e Fix bad-utf8-len bug.
* module/ice-9/ports.scm (bad-utf8-len): Fix bug.
2016-05-10 15:37:11 +02:00
Andy Wingo
0dd18191bc clear-stream-start-for-bom-read refactor
* module/ice-9/ports.scm (clear-stream-start-for-bom-read): Use the
  "buffered" value that fill-input returns.
2016-05-10 15:36:31 +02:00
Andy Wingo
502e3a2213 Fix port-clear-stream-start-for-bom-read logic.
* libguile/ports.c (scm_port_clear_stream_start_for_bom_read): Fix
  logic.
2016-05-10 15:36:06 +02:00
Andy Wingo
837a7e0810 Scheme peek-char can handle iconv encodings
* module/ice-9/ports.scm (peek-char-and-len/iconv): Fully implement.
2016-05-10 12:48:10 +02:00
Andy Wingo
8ee189980d Factor out iconv to port-decode-char
* libguile/ports.c (scm_port_decode_char): New helper, exported
  to (ice-9 ports).
  (peek_iconv_codepoint): Use scm_port_decode_char.
2016-05-10 12:45:56 +02:00
Andy Wingo
08c67dbef8 Simplify decoding error handling
* libguile/ports.c (peek_utf8_codepoint, peek_latin1_codepoint):
  (peek_iconv_codepoint, peek_codepoint): Refactor to push error
  handling to the leaves, where errors happen.  Just return
  the (possibly substituted) codepoint, without an error code; if
  there's really an error, we should raise it.
  (scm_getc, scm_peek_char): Adapt.
2016-05-10 12:09:30 +02:00
Andy Wingo
1953d29038 Decoding errors do not advance read pointer
* libguile/ports.c (scm_getc): If the port conversion strategy is
  'error, signal an error before advancing the read pointer.  This is a
  change from previous behavior; before, we advanced the read pointer
  under an understanding that that was what R6RS required.  But, that
  seems to be not the case.
* test-suite/tests/ports.test ("string ports"): Update decoding-error
  tests to assume that read-char with an error doesn't advance the read
  pointer.
* test-suite/tests/rdelim.test ("read-line"): Likewise.
2016-05-10 11:36:28 +02:00
Andy Wingo
83e5ccb02f Fix bug in trampoline_to_c_read
* libguile/ports.c (trampoline_to_c_read): Fix bug comparing SCM
  values.
2016-05-10 11:08:41 +02:00
Andy Wingo
d77b50476a Speed refactors to Scheme %peek-char
* module/ice-9/ports.scm (peek-bytes): New helper.
  (peek-byte): Use peek-bytes helper.
  (decoding-error): Don't inline; no need.
  (decode-utf8, bad-utf8-len): New helpers.
  (peek-char-and-len/utf8): Use new helpers.
  (peek-char-and-len): No fast paths, and not inline.  Peek-char has its
  own fast path.
  (%peek-char): Use helpers to make fast path.
2016-05-07 12:41:07 +02:00
Andy Wingo
13f2128587 Fix port-clear-stream-start-for-bom-read bug
* libguile/ports.c (scm_port_clear_stream_start_for_bom_read): Fix to
  return SCM_BOOL_F instead of 0.
2016-05-07 12:40:46 +02:00
Andy Wingo
bed7bdc19c Fix use of port-encoding
* module/ice-9/ports.scm (clear-stream-start-for-bom-read): Fix to use
  %port-encoding, which works in symbols.
2016-05-05 23:03:04 +02:00
Andy Wingo
0b4b4db9fa Speed up peek-char
* module/ice-9/ports.scm (peek-char-and-len): Only inline fast path for
  UTF-8.
2016-05-05 22:57:33 +02:00
Andy Wingo
6d15a71e8f Port to Scheme of new BOM handling
* libguile/ports.c (scm_specialize_port_encoding_x)
  (scm_port_clear_stream_start_for_bom_read): New functions exported
  to (ice-9 ports).
* module/ice-9/ports.scm (clear-stream-start-for-bom-read):
  (fill-input, peek-char-and-len): Rework to handle BOM in fill-input
  instead of once per peek-char.
2016-05-05 22:54:58 +02:00
Andy Wingo
86267af8b3 Handle BOM around fill/flush instead of peek/put
* libguile/print.c (display_string_using_iconv): Remove BOM handling;
  this is now handled by scm_lfwrite.
* libguile/ports.c (open_iconv_descriptors): Refactor to take encoding
  as a symbol.
  (prepare_iconv_descriptors): New helper.
  (scm_i_port_iconv_descriptors): Remove scm_t_port_rw_active argument,
  and don't sniff UTF-16/UTF-32 byte orders here.  Instead BOM handlers
  will call prepare_iconv_descriptors.
  (scm_c_read_bytes): Call new port_clear_stream_start_for_bom_read
  helper.
  (port_maybe_consume_initial_byte_order_mark)
  (scm_port_maybe_consume_initial_byte_order_mark): Remove.  Leaves
  Scheme %peek-char broken but it's unused currently so that's OK.
  (peek_iconv_codepoint): Fetch iconv descriptors after doing fill-input
  because it's fill-input that will sniff the BOM.
  (peek_codepoint): Instead of handling BOM at every character, handle
  in fill-input instead.
  (maybe_consume_bom, port_clear_stream_start_for_bom_read)
  (port_clear_stream_start_for_bom_write): New helpers.
  (scm_fill_input): Slurp a BOM if needed.
  (scm_i_write): Clear the start-of-stream-for-bom-write flag.
  (scm_lfwrite): Write a BOM if needed.
2016-05-05 13:00:19 +02:00
Andy Wingo
d7a111b0ec Spead tweaks to Scheme peek-char
* module/ice-9/ports.scm: Speed tweaks to %peek-char.  Ultimately
  somewhat fruitless; I can get 1.4s instead of 1.5s by only
  half-inlining the UTF-8 case though.
2016-05-04 12:40:27 +02:00
Andy Wingo
f5b9a53bd0 Add integer->char and char->integer opcodes
* libguile/vm-engine.c (integer_to_char, char_to_integer): New opcodes.
* libguile/vm.c (vm_error_not_a_char): New error case.
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/slot-allocation.scm (compute-var-representations):
* module/language/cps/types.scm:
* module/language/tree-il/compile-cps.scm (convert):
* doc/ref/vm.texi (Inlined Scheme Instructions):
* module/system/vm/assembler.scm: Add support for new opcodes.
2016-05-04 12:36:41 +02:00
Andy Wingo
2ba638092f Initial peek-char implementation in Scheme
* module/ice-9/ports.scm (EILSEQ, decoding-error, peek-char-and-len/utf8):
  (peek-char-and-len/iso-8859-1, peek-char-and-len/iconv):
  (peek-char-and-len, %peek-char): New definitions.  Missing iconv1 for
  peek-char, but enough to benchmark.
2016-05-04 11:48:05 +02:00
Andy Wingo
36e32138f8 Port refactors to help Scheme peek-char
* libguile/ports.h (scm_sys_port_encoding, scm_sys_set_port_encoding):
  New functions, to expose port encodings as symbols directly to (ice-9
  ports).
  (scm_port_maybe_consume_initial_byte_order_mark): New function.
* libguile/ports.c (scm_port_encoding): Dispatch to %port-encoding.
  (scm_set_port_encoding_x): Dispatch to %set-port-encoding!.
  (port_maybe_consume_initial_byte_order_mark): New helper, factored out
  of peek_codepoint.
  (scm_port_maybe_consume_initial_byte_order_mark, peek_codepoint): Call
  port_maybe_consume_initial_byte_order_mark.
* module/ice-9/ports.scm (port-encoding): Implement in Scheme.
2016-05-04 11:47:42 +02:00
Andy Wingo
383df7976f Port conversion strategies internally are symbols
* libguile/ports.h (scm_t_port): Represent the conversion strategy as a
  symbol, to make things easier for Scheme.  Rename to
  "conversion_strategy".
  (scm_c_make_port_with_encoding): Change to take encoding and
  conversion_strategy arguments as symbols.
  (scm_i_string_failed_conversion_handler): New internal helper, to turn
  a symbol to a scm_t_string_failed_conversion_handler.
  (scm_i_default_port_encoding): Return the default port encoding as a
  symbol.
  (scm_i_default_port_conversion_strategy)
  (scm_i_set_default_port_conversion_strategy): Rename from
  scm_i_default_port_conversion_handler et al.  Take and return Scheme
  symbols.
* libguile/foreign.c (scm_string_to_pointer, scm_pointer_to_string): Use
  scm_i_default_string_failed_conversion_handler instead of
  scm_i_default_port_conversion_handler.
* libguile/print.c (PORT_CONVERSION_HANDLER): Update definition.
  (print_normal_symbol): Use PORT_CONVERSION_HANDLER.
* libguile/r6rs-ports.c (make_bytevector_input_port):
  (make_custom_binary_input_port, make_bytevector_output_port): Adapt to
  changes in scm_c_make_port_with_encoding.
* libguile/strings.h:
* libguile/strings.c (scm_i_default_string_failed_conversion_handler):
  New helper.
  (scm_from_locale_stringn, scm_from_port_stringn):
  (scm_to_locale_stringn, scm_to_port_stringn): Adapt to interface
  changes.
* libguile/strports.c (scm_mkstrport): Adapt to
  scm_c_make_port_with_encoding change.
* libguile/ports.c (scm_c_make_port): Adapt to
  scm_c_make_port_with_encoding change.
  (ascii_toupper, encoding_matches, canonicalize_encoding): Move down in
  the file.
  (peek_codepoint, get_codepoint, scm_ungetc): Adapt to port conversion
  strategy change.  Remove duplicate case in get_codepoint.
  (scm_init_ports): Move symbol initializations to the same place.
2016-05-04 10:41:07 +02:00
Andy Wingo
d8711b9759 Port encoding internally represented as symbol
* libguile/ports-internal.h (scm_t_port_internal): Remove encoding_mode
  member.
* libguile/ports.h (scm_t_port): "encoding" member is now a SCM symbol.
* libguile/ports.c (scm_init_ports): Define symbols for the encodings
  that we handle explicitly.
  (encoding_matches): Adapt to check against an encoding as a symbol.
  (canonicalize_encoding): Return an encoding as a symbol.
  (scm_c_make_port_with_encoding, scm_i_set_default_port_encoding)
  (decide_utf16_encoding, decide_utf32_encoding)
  (scm_i_port_iconv_descriptors, scm_i_set_port_encoding_x)
  (scm_port_encoding, peek_codepoint, scm_ungetc): Adapt to encoding
  change.

* libguile/print.c (display_string_using_iconv, display_string):
* libguile/read.c (scm_read_character):
* libguile/strings.c (scm_from_port_stringn, scm_to_port_stringn): Adapt
  to port encoding change.
2016-05-03 10:52:54 +02:00
Andy Wingo
422f65fe09 Minor tweak to Scheme peek-byte.
* module/ice-9/ports.scm (peek-byte): Use second return from
  fill-input.
2016-05-01 22:00:37 +02:00
Andy Wingo
4ba59e94f9 Changes to Scheme fill-input corresponding to C
* module/ice-9/ports.scm (fill-input): Rewrite to make changes like the
  ones made to the C scm_fill_input: allow callers to specify a minimum
  amount of buffering.
2016-05-01 21:57:32 +02:00
Andy Wingo
1309ab8093 Char readers peek into read buffer
* libguile/ports.c (scm_i_set_pending_eof): Remove now-unused helper.
  (peek_utf8_codepoint, peek_latin1_codepoint, peek_iconv_codepoint):
  (peek_codepoint): Refactor the fundamental character readers in Guile
  to peek into the read buffer instead of reading then unreading.  This
  will allow Scheme to use the port buffer to convert, when we port this
  to Scheme.
  (get_codepoint): Use peek_codepoint.
  (scm_getc): Adapt.
  (scm_peek_char): Use peek_codepoint.
2016-05-01 16:58:57 +02:00
Andy Wingo
56c48d14ac scm_fill_input can guarantee a minimum fill amount
* libguile/ports.h (scm_fill_input): Add "minimum_size" argument.  Adapt
  all callers to pass 0 as this argument.
* libguile/ports.c (scm_i_read): Inline into scm_fill_input.
  (scm_fill_input): "minimum_size" argument ensures that there are a
  certain number of bytes available, or EOF.  Instead of shrinking the
  read buffer, only fill by the read_buffering amount, or the
  minimum_size, whichever is larger.
* libguile/r6rs-ports.c:
* libguile/read.c: Adapt scm_fill_input callers.
2016-05-01 14:29:17 +02:00
Andy Wingo
6a752bcf2a peek-byte in Scheme
* libguile/ports.c (trampoline_to_c_read, trampoline_to_c_write): Since
  C might assume that the indices are within bounds of the bytevector,
  verify them more here.
  (scm_port_random_access_p, scm_port_read_buffering)
  (scm_set_port_read_buffer, scm_port_read, scm_port_write): New helpers
  exposed to (ice-9 ports).
  (scm_port_read_buffer, scm_port_write_buffer): Don't flush or validate
  port mode; we do that in Scheme.
* module/ice-9/ports.scm: Implement enough of port machinery to
  implement peek-byte in Scheme.  Not yet exported.
2016-04-30 14:46:45 +02:00
Andy Wingo
300c85b0f0 Tweak port initialization order
* libguile/init.c (scm_i_init_guile): Initialize ports before
  strports/fports, so that we have initialized the read/write
  trampolines before making port types.
2016-04-30 14:45:44 +02:00
Andy Wingo
555c934726 Refactor way the-eof-object is defined
* libguile/ports.c (scm_init_ice_9_ports): Define the-eof-object here.
  Update a comment.
* module/ice-9/ports.scm: Use the-eof-object definition from C.
2016-04-30 14:44:20 +02:00
Andy Wingo
8bad621fec Add SCM port read/write functions
* libguile/ports.h (scm_t_ptob_descriptor): Add "scm_read" and
  "scm_write" members, for calling from Scheme.
  (scm_set_port_scm_read, scm_set_port_scm_write): New procedures.
* libguile/ports.c (trampoline_to_c_read_subr)
  (trampoline_to_c_write_subr): New static variables.
* libguile/ports.c (scm_make_port_type): Initialize scm_read and
  scm_write members to trampoline to C.
  (trampoline_to_c_read, trampoline_to_scm_read)
  (trampoline_to_c_write, trampoline_to_scm_write): New helpers.
  (scm_set_port_scm_read, scm_set_port_scm_write): New functions.
  (default_buffer_size): Move definition down.
  (scm_i_read_bytes, scm_i_write_bytes): Use new names for read and
  write procedures.
  (scm_init_ports): Initialize trampolines.
2016-04-30 11:59:33 +02:00
Andy Wingo
2b47043052 Remove port locks
* libguile/ports.h (scm_t_port): Remove lock field.
  (scm_dynwind_lock_port, scm_c_lock_port, scm_c_try_lock_port):
  Remove.
* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x):
  Remove locking.
* libguile/ports.c (scm_c_make_port_with_encoding): Remove lock.
  (scm_i_read_bytes, scm_i_read, scm_i_write_bytes, scm_i_write): Remove
  "_unlocked" from names and adapt callers.
2016-04-28 08:34:08 +02:00
Andy Wingo
8b46a4af44 Optimize peek-char
* libguile/ports.c (scm_peek_char): Optimize.  A loop calling peek-char
  on a buffered string port 10e6 times goes down from 50ns/iteration to
  32ns/iteration.
2016-04-28 08:16:43 +02:00
Andy Wingo
ee4854a315 Remove port locking around write, display
* libguile/print.c (scm_write, scm_display):
* libguile/read.c (set_port_read_option): Remove port locking.  Reading
  and writing to the same port from multiple threads just must not
  crash; it doesn't have to make sense.
2016-04-28 08:16:42 +02:00
Andy Wingo
15d5304723 scm_lfwrite, not scm_lfwrite_unlocked
* libguile/ports.h (scm_lfwrite_unlocked): Remove.
* libguile/ports.c (scm_lfwrite): Rename from scm_lfwrite_unlocked.
* libguile/numbers.c:
* libguile/print.c: Adapt to call scm_lfwrite.
2016-04-26 23:17:22 +02:00
Andy Wingo
d0b9d3b04d Remove scm_c_write_unlocked
* libguile/ports.h (scm_c_write_bytes_unlocked): Remove.
* libguile/ports.c (scm_c_write_bytes): Rename from
  scm_c_write_bytes_unlocked, make public, and return void.
  (scm_c_write): Rename from scm_c_write_unlocked.  Remove locked
  variant.
  (scm_lfwrite_unlocked): Call scm_c_write.
* libguile/rw.c (scm_write_string_partial): Call scm_c_write.
2016-04-26 23:13:32 +02:00
Andy Wingo
105e36543f Remove scm_puts_unlocked.
* libguile/ports.h (scm_puts_unlocked): Remove.
* libguile/ports.c (scm_puts): Replace implementation with
  scm_puts_unlocked's implementation.
* libguile/arbiters.c:
* libguile/backtrace.c:
* libguile/bitvectors.c:
* libguile/continuations.c:
* libguile/deprecation.c:
* libguile/dynl.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/guardians.c:
* libguile/hashtab.c:
* libguile/hooks.c:
* libguile/load.c:
* libguile/macros.c:
* libguile/mallocs.c:
* libguile/print.c:
* libguile/programs.c:
* libguile/promises.c:
* libguile/smob.c:
* libguile/srcprop.c:
* libguile/srfi-14.c:
* libguile/stackchk.c:
* libguile/struct.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/values.c:
* libguile/variable.c:
* libguile/vm.c:
* libguile/weak-set.c:
* libguile/weak-table.c: Use scm_puts instead of scm_puts_unlocked.
2016-04-26 23:07:28 +02:00
Andy Wingo
206b3f6e03 Remove scm_putc_unlocked.
* libguile/ports.h (scm_putc_unlocked): Remove.
* libguile/ports.c (scm_putc): Replace implementation with
  scm_putc_unlocked's implementation.
  (scm_port_print): Use scm_putc.
* libguile/arbiters.c:
* libguile/arrays.c:
* libguile/bitvectors.c:
* libguile/bytevectors.c:
* libguile/continuations.c:
* libguile/dynl.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/hashtab.c:
* libguile/hooks.c:
* libguile/macros.c:
* libguile/mallocs.c:
* libguile/print.c:
* libguile/programs.c:
* libguile/promises.c:
* libguile/r6rs-ports.c:
* libguile/smob.c:
* libguile/srcprop.c:
* libguile/struct.c:
* libguile/variable.c:
* libguile/weak-set.c:
* libguile/weak-table.c: Use scm_putc instead of scm_putc_unlocked.
2016-04-26 23:01:14 +02:00
Andy Wingo
796676028b Remove scm_fill_input_unlocked
* libguile/ports.h (scm_fill_input_unlocked): Remove.
* libguile/ports.c (scm_fill_input): Rename from
  scm_fill_input_unlocked.  Adapt callers.
* libguile/r6rs-ports.c (scm_get_bytevector_some): Adapt.
* libguile/read.c (scm_i_scan_for_encoding): Adapt.
2016-04-26 22:37:04 +02:00
Andy Wingo
abf90c4e72 Remove locking in scm_end_input
* libguile/ports.c (scm_end_input): Sadly, we can't naively lock around
  the scm_port_buffer_take, as it might throw.  Will revisit in the
  future.
2016-04-26 22:11:41 +02:00
Andy Wingo
122c8e6b37 scm_ungetc, scm_ungets instead of _unlocked variants
* libguile/ports.h (scm_ungetc_unlocked, scm_ungets_unlocked): Remove;
  replace with scm_ungetc, scm_ungets.
* libguile/ports.c (scm_ungetc, scm_ungets, scm_unread_char)
  (scm_unread_string): Adapt.
* libguile/rdelim.c (scm_read_delimited_x): Use scm_ungetc.
* libguile/read.c: Unread characers with scm_ungetc, not
  scm_ungetc_unlocked.
2016-04-23 22:20:18 +02:00
Andy Wingo
21650f8d52 Remove scm_unget_{byte,bytes}_unlocked
* libguile/ports.h (scm_unget_bytes_unlocked, scm_unget_byte_unlocked):
  Remove.
* libguile/ports.c (looking_at_bytes): Use scm_unget_bytes instead of
  scm_i_unget_bytes_unlocked
  (scm_unget_bytes): Rename from scm_i_unget_bytes_unlocked.  Remove
  other implementations of this function.
  (scm_unget_byte): Likewise.
  (scm_ungetc_unlocked, scm_peek_char): Use scm_unget_byte.
* libguile/read.c (read_token): Use scm_unget_byte.
2016-04-23 21:53:54 +02:00