summaryrefslogtreecommitdiffstats
path: root/ioext.c
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:37 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:37 -0800
commit710a97992705d67c3ded0d4b270c5978ce29b11f (patch)
treeddcb2f7a91cbb86ce582e74227768b7b898c29e1 /ioext.c
parent50eb784bfcf15ee3c6b0b53d747db92673395040 (diff)
downloadscm-710a97992705d67c3ded0d4b270c5978ce29b11f.tar.gz
scm-710a97992705d67c3ded0d4b270c5978ce29b11f.zip
Import Upstream version 5e4upstream/5e4
Diffstat (limited to 'ioext.c')
-rw-r--r--ioext.c47
1 files changed, 2 insertions, 45 deletions
diff --git a/ioext.c b/ioext.c
index 62efc2b..9f4ada7 100644
--- a/ioext.c
+++ b/ioext.c
@@ -193,49 +193,8 @@ static char s_write_line[] = "write-line";
SCM l_write_line(obj, port)
SCM obj, port;
{
- display(obj, port);
- return newline(port);
-}
-
-static char s_file_position[] = "file-position",
- s_file_set_pos[] = "file-set-position";
-SCM file_position(port)
- SCM port;
-{
- long ans;
- ASRTER(NIMP(port) && OPFPORTP(port), port, ARG1, s_file_position);
- SYSCALL(ans = ftell(STREAM(port)););
- if (CRDYP(port)) ans--;
- return MAKINUM(ans);
- }
-SCM file_set_position(port, pos)
- SCM port, pos;
-{
- SCM ans;
- ASRTER(NIMP(port) && OPFPORTP(port), port, ARG1, s_file_set_pos);
-#ifndef RECKLESS
- if (TRACKED & SCM_PORTFLAGS(port)) {
- if (INUM0==pos) {
- int i = SCM_PORTNUM(port);
- scm_port_table[i].line = 1L;
- scm_port_table[i].col = 1;
- }
- else {
- if (2 <= verbose)
- scm_warn("Setting file position for tracked port: ", "", port);
- SCM_PORTFLAGS(port) &= (~TRACKED);
- }
- }
-#endif
- CLRDY(port); /* Clear ungetted char */
- SYSCALL(ans = (fseek(STREAM(port), INUM(pos), 0)) ? BOOL_F : BOOL_T;);
-#ifdef HAVE_PIPE
-# ifdef ESPIPE
- if (!OPIOPORTP(port))
- ASRTER(ESPIPE != errno, port, ARG1, s_file_set_pos);
-# endif
-#endif
- return ans;
+ scm_display(obj, port);
+ return scm_newline(port);
}
static char s_reopen_file[] = "reopen-file";
@@ -792,7 +751,6 @@ SCM l_putenv(str)
#endif
static iproc subr1s[] = {
- {s_file_position, file_position},
{s_fileno, l_fileno},
#ifndef MCH_AMIGA
# ifndef vms
@@ -877,7 +835,6 @@ SCM scm_try_create_file(fname, modes, perms)
#endif
static iproc subr2os[] = {
- {s_file_set_pos, file_set_position},
{s_read_line1, read_line1},
{s_write_line, l_write_line},
{0, 0}};