% File 'prolog_io.pl'
%----
:- import(prolog_meta).


% I/O

% type filename is declared in prolog_meta.pl

:- type stream --> user.             % abstract exported in version 0.4
:- type atom > stream.

:- type options == top.

% Byte I/O
:- type byte == nat.
:- pred get_byte(byte).                   	% StdP
:- pred get_byte(stream,byte).			% StdP
:- pred peek_byte(byte).			% StdP
:- pred peek_byte(stream,byte).			% StdP
:- pred put_byte(byte).				% StdP
:- pred put_byte(stream,byte).			% StdP

% Character I/O
:- pred get_char(char).				% StdP
:- pred get_char(stream,char).			% StdP
:- pred get_code(char_code).			% StdP
:- pred get_code(stream,char_code).		% StdP
:- pred get0(char_code).                        %%% rk: Sicstus-Prolog
:- pred get0(stream, char_code).                %%% rk: Sicstus-Prolog
:- pred get(char_code).                         %%% rk: Sicstus-Prolog
:- pred get(stream, char_code).                 %%% rk: Sicstus-Prolog
:- pred peek_char(char).			% StdP 
:- pred peek_char(stream,char).			% StdP
:- pred peek_code(char_code).			% StdP %%% Sicstus: peek_char/1
:- pred peek_code(stream,char_code).		% StdP %%% Sicstus: peek_char/2
:- pred put_char(char).				% StdP
:- pred put_char(stream,char).			% StdP
:- pred put_code(char_code).			% StdP
:- pred put_code(stream,char_code).		% StdP
:- pred nl.					% StdP
:- pred nl(stream).				% StdP
:- pred skip(char_code).                        %%% rk: Sicstus-Prolog
:- pred skip(stream,char_code).                 %%% rk: Sicstus-Prolog
:- pred skip_line.                              %%% rk: Sicstus-Prolog
:- pred skip_line(stream).                      %%% rk: Sicstus-Prolog
:- pred put(char_code).                         %%% rk: Sicstus-Prolog
:- pred put(stream, char_code).                 %%% rk: Sicstus-Prolog
:- pred tab(char_code).                         %%% rk: Sicstus-Prolog
:- pred tab(stream, char_code).                 %%% rk: Sicstus-Prolog



% Term I/O
:- pred read(term).				% StdP
:- pred read(stream,term).			% StdP
:- pred read_term(term,options).		% StdP
:- pred read_term(stream,term,options).		% StdP
:- pred write(term).				% StdP
:- pred write(stream,term).			% StdP
:- pred write_canonical(term).			% StdP
:- pred write_canonical(stream,term).		% StdP
:- pred write_term(term,options).		% StdP
:- pred write_term(stream,term,options).	% StdP
:- pred writeq(term).				% StdP
:- pred writeq(stream,term).			% StdP
 
:- type op_assoc --> xfx;xfy;yfx;fy;fx;xf;yf.
:- pred op(int,op_assoc,atom).			% StdP
% :- pred op(int,op_assoc,list(atom)).		% StdP
:- pred current_op(int,op_assoc,atom).		% StdP

% Stream selection and control
:- type io_mode --> read; write; append.
:- pred at_end_of_stream.				% StdP
:- pred at_end_of_stream(stream).			% StdP
:- pred close(stream).				% StdP
:- pred close(stream,options).			% StdP
:- pred current_input(stream).			% StdP
:- pred current_output(stream).			% StdP
:- pred flush_output.				% StdP
:- pred flush_output(stream).			% StdP
:- pred open(filename,io_mode,stream).		% StdP
:- pred open(filename,io_mode,stream,options).	% StdP
:- pred set_input(stream).			% StdP
:- pred set_output(stream).			% StdP
:- pred set_stream_position(stream,top).	% StdP
:- pred stream_property(stream,top).		% StdP
:- pred seen.
:- pred seeing(stream).
:- pred see(stream).
:- pred told.
:- pred telling(stream).
:- pred tell(stream).
:- pred nofileerrors.
:- pred fileerrors.

:- pred absolute_file_name(filename,filename).

:- pred print(top).  % not Std

