SWI seems to use t=0 for user_input/output. Not very clear why...

This commit is contained in:
Vítor Santos Costa
2010-12-15 20:03:22 +00:00
parent d1665c7462
commit 4546a22101
4 changed files with 24 additions and 11 deletions

View File

@@ -4340,12 +4340,16 @@ static const PL_extension foreigns[] = {
};
static int
get_stream_handle_no_errors(term_t t, IOSTREAM **s)
get_stream_handle_no_errors(term_t t, int read, int write, IOSTREAM **s)
{ GET_LD
if ( t == 0 )
{ if (write) *s = getStream(Scurout);
else *s = getStream(Scurout);
return TRUE;
}
return get_stream_handle(t, s, SH_ALIAS);
}
static void
init_yap_extras(void)
{
@@ -4357,7 +4361,7 @@ init_yap_extras(void)
swiio.get_w = Sgetcode;
swiio.put_w = Sputcode;
swiio.flush_s = Sflush;
swiio.close_s = Sclose;
swiio.close_s = closeStream;
swiio.get_stream_handle = get_stream_handle_no_errors;
PL_YAP_InitSWIIO(&swiio);
initCharTypes();