nl should be in the SWI IO (obs from Roberto Bagnara).

This commit is contained in:
Vítor Santos Costa 2010-12-12 19:07:24 +00:00
parent 2d1ece71c8
commit 51e9cb14a7
2 changed files with 31 additions and 1 deletions

View File

@ -225,6 +225,8 @@ goal_expansion(file_base_name(A,B),system:swi_file_base_name(A,B)) :- swi_io.
goal_expansion(file_directory_name(A,B),system:swi_file_directory_name(A,B)) :- swi_io.
goal_expansion('$mark_executable'(A), system:'swi_is_absolute_file_name'(A)) :- swi_io.
goal_expansion('$absolute_file_name'(A,B),system:'swi_$absolute_file_name'(A,B)) :- swi_io.
goal_expansion(nl(A),system:swi_nl(A)) :- swi_io.
goal_expansion(nl,system:swi_nl) :- swi_io.
% make sure we also use

View File

@ -4215,6 +4215,7 @@ PRED_IMPL("copy_stream_data", 2, copy_stream_data2, 0)
}
/*******************************
* PUBLISH PREDICATES *
*******************************/
@ -4312,8 +4313,34 @@ static pl_Sgetc(IOSTREAM *s)
return Sgetc(s);
}
/* copied by VSC */
static word
pl_nl1(term_t stream)
{ IOSTREAM *s;
if ( getOutputStream(stream, &s) )
{ Sputcode('\n', s);
return streamStatus(s);
}
fail;
}
static word
pl_nl()
{ return pl_nl1(0);
}
static const PL_extension foreigns[] = {
FRG("swi_nl", 0, pl_nl, ISO),
FRG("swi_nl", 1, pl_nl1, ISO),
/* DO NOT ADD ENTRIES BELOW THIS ONE */
FRG((char *)NULL, 0, NULL, 0)
};
static void
init_yap_extras()
init_yap_extras(void)
{
swi_io_struct swiio;
@ -4329,6 +4356,7 @@ init_yap_extras()
initFiles();
initGlob();
PL_register_extensions(PL_predicates_from_file);
PL_register_extensions(foreigns);
fileerrors = TRUE;
SinitStreams();
}