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

@@ -172,7 +172,7 @@ PipeGetc(int sno)
int count;
count = read(s->u.pipe.fd, &c, sizeof(char));
if (count == 0) {
return post_process_eof(s);
return EOF;
} else if (count > 0) {
ch = c;
} else {
@@ -181,9 +181,9 @@ PipeGetc(int sno)
#else
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "at pipe getc");
#endif
return post_process_eof(s);
return EOF;
}
return post_process_read_char(ch, s);
return ch;
}
void