Simplify Input/Output

get rid of string I/O, did not add much
getc is never actually used by Prolog
try to use system I/O, even if it may be slower, at least for now.
extend IO C-interface to allow reading clauses
This commit is contained in:
Vítor Santos Costa
2016-02-21 19:06:25 +00:00
parent 19cedad41d
commit f7d23f9deb
11 changed files with 346 additions and 334 deletions

View File

@@ -103,7 +103,7 @@ SocketGetc(int sno)
#endif
if (count == 0) {
s->u.socket.flags = closed_socket;
return post_process_eof(s);
return EOF;
} else if (count > 0) {
ch = c;
} else {
@@ -114,9 +114,9 @@ SocketGetc(int sno)
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil,
"(socket_getc)");
#endif
return post_process_eof(s);
return EOF;
}
return post_process_read_char(ch, s);
return ch;
}
/*
@@ -158,7 +158,7 @@ ConsoleSocketGetc(int sno)
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "read");
return console_post_process_eof(s);
}
return console_post_process_read_char(ch, s);
return ch;
}
/* static */