%
% ECLiPSe 5 changed get0/2 to get_code/2 in it's ISO library.
% Now we have to wrap this up in a predicate get_character/2.
%

:- module(get_character,[get_character/2]).

:- [prolog_detect].
:- prolog_detect:prolog(Prolog),
	(	(Prolog=eclipse,
		!,
		use_module(library(iso))
		);
		true
		
	).

get_character(Stream,C) :-
	prolog_detect:prolog(Prolog),
	get_character(Prolog,Stream,C).

get_character(sicstus,Stream,C) :-
	!,
	get0(Stream,C).

get_character(pfdm,Stream,C) :-
	!,
	get0(Stream,C).

get_character(eclipse,Stream,C) :-
	!,
	iso:get_code(Stream,C).

get_character(swi,Stream,C) :-
	!,
	get0(Stream,C).

get_character(_,_,_) :-
	write('*** Unsupported Prolog system in get_character/2 ***'),
	nl,
	fail.
