Merge branch 'master' of ../yap-6.2
This commit is contained in:
23
C/iopreds.c
23
C/iopreds.c
@@ -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--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user