Merge branch 'master' of ../yap-6.2

This commit is contained in:
Vítor Santos Costa
2011-02-02 16:15:50 +00:00
62 changed files with 1541 additions and 165 deletions

View File

@@ -827,12 +827,16 @@ IOSWIPutc(int sno, int ch)
static int
IOSWIGetc(int sno)
{
int i;
int ch;
Yap_StartSlots();
i = (SWIGetc)(Stream[sno].u.swi_stream.swi_ptr);
ch = (SWIGetc)(Stream[sno].u.swi_stream.swi_ptr);
if (ch == EOF) {
return post_process_eof(Stream+sno);
}
return post_process_read_char(ch, Stream+sno);
Yap_CloseSlots();
YENV = ENV;
return i;
return ch;
}
/* static */
@@ -851,12 +855,16 @@ IOSWIWidePutc(int sno, int ch)
static int
IOSWIWideGetc(int sno)
{
int i;
int ch;
Yap_StartSlots();
i = (SWIWideGetc)(Stream[sno].u.swi_stream.swi_ptr);
ch = (SWIWideGetc)(Stream[sno].u.swi_stream.swi_ptr);
if (ch == EOF) {
return post_process_eof(Stream+sno);
}
return post_process_read_char(ch, Stream+sno);
Yap_CloseSlots();
YENV = ENV;
return i;
return ch;
}
#if USE_SOCKET
@@ -4759,6 +4767,9 @@ StreamPosition(int sno)
Term sargs[5];
Int cpos;
cpos = Stream[sno].charcount;
if (Stream[sno].status & SWI_Stream_f) {
return Yap_get_stream_position(Stream[sno].u.swi_stream.swi_ptr);
}
if (Stream[sno].stream_getc == PlUnGetc) {
cpos--;
}