:- module(charsio, [char_type/2,
chars_utf8bytes/2,
get_single_char/1,
- read_n_chars/3,
+ get_n_chars/3,
read_line_to_chars/3,
read_from_chars/2,
write_term_to_chars/3,
characters read.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-read_n_chars(Stream, N, Cs) :-
+get_n_chars(Stream, N, Cs) :-
can_be(integer, N),
( var(N) ->
read_to_eof(Stream, Cs),
:- use_module(library(freeze)).
:- use_module(library(iso_ext), [setup_call_cleanup/3, partial_string/3]).
:- use_module(library(lists), [member/2, maplist/2]).
-:- use_module(library(charsio), [read_n_chars/3]).
+:- use_module(library(charsio), [get_n_chars/3]).
:- meta_predicate(phrase_from_file(2, ?)).
:- meta_predicate(phrase_from_file(2, ?, ?)).
set_stream_position(Stream, Pos),
( at_end_of_stream(Stream)
-> Xs0 = []
- ; read_n_chars(Stream, 4096, Cs),
+ ; get_n_chars(Stream, 4096, Cs),
partial_string(Cs, Xs0, Xs),
stream_to_lazy_list(Stream, Xs)
).