From c94577b4456b27ab035a26ffabae4b43fe83872e Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Thu, 12 Aug 1999 18:58:55 +0000 Subject: [PATCH] 1999-08-12 Gary Houston * ports.c (scm_seek): one more: was scm_lseek. Also changed the Scheme name from lseek to seek, but lseek was added recently so it shouldn't be a big problem. * ports.c, gdbint.c, ioext.c: changed callers. --- NEWS | 4 ++-- libguile/ChangeLog | 7 +++++++ libguile/gdbint.c | 6 +++--- libguile/ioext.c | 4 ++-- libguile/ports.c | 18 +++++++++--------- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/NEWS b/NEWS index 22105450f..30a3da0a7 100644 --- a/NEWS +++ b/NEWS @@ -1040,12 +1040,12 @@ work on any kind of port, not just ports which are open on a file. as file ports. If the size argument is omitted, the current file position is used. -** new procedure: lseek PORT/FDES OFFSET WHENCE +** new procedure: seek PORT/FDES OFFSET WHENCE The arguments are the same as for the old fseek procedure, but it works on string ports as well as random-access file ports. ** the fseek procedure now works on string ports, since it has been -redefined using lseek. +redefined using seek. ** the setvbuf procedure now uses a default size if mode is _IOFBF and size is not supplied. diff --git a/libguile/ChangeLog b/libguile/ChangeLog index d77cfa7c3..72b0a3fbd 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +1999-08-12 Gary Houston + + * ports.c (scm_seek): one more: was scm_lseek. Also changed the + Scheme name from lseek to seek, but lseek was added recently so + it shouldn't be a big problem. + * ports.c, gdbint.c, ioext.c: changed callers. + 1999-08-11 Gary Houston * fports.c (fport_input_waiting): if select is used, return 1 diff --git a/libguile/gdbint.c b/libguile/gdbint.c index 677996aee..d1b164f63 100644 --- a/libguile/gdbint.c +++ b/libguile/gdbint.c @@ -205,10 +205,10 @@ gdb_read (str) } SCM_BEGIN_FOREIGN_BLOCK; unmark_port (gdb_input_port); - scm_lseek (gdb_input_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET)); + scm_seek (gdb_input_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET)); scm_puts (str, gdb_input_port); scm_truncate_file (gdb_input_port, SCM_UNDEFINED); - scm_lseek (gdb_input_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET)); + scm_seek (gdb_input_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET)); /* Read one object */ tok_buf_mark_p = SCM_GC8MARKP (tok_buf); SCM_CLRGC8MARK (tok_buf); @@ -267,7 +267,7 @@ gdb_print (obj) RESET_STRING; SCM_BEGIN_FOREIGN_BLOCK; /* Reset stream */ - scm_lseek (gdb_output_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET)); + scm_seek (gdb_output_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET)); scm_write (obj, gdb_output_port); scm_truncate_file (gdb_output_port, SCM_UNDEFINED); SEND_STRING (SCM_CHARS (SCM_STREAM (gdb_output_port))); diff --git a/libguile/ioext.c b/libguile/ioext.c index f9b75dc31..5f4897586 100644 --- a/libguile/ioext.c +++ b/libguile/ioext.c @@ -299,7 +299,7 @@ SCM scm_ftell (object) SCM object; { - return scm_lseek (object, SCM_INUM0, SCM_MAKINUM (SEEK_CUR)); + return scm_seek (object, SCM_INUM0, SCM_MAKINUM (SEEK_CUR)); } SCM_PROC (s_fseek, "fseek", 3, 0, 0, scm_fseek); @@ -310,7 +310,7 @@ scm_fseek (object, offset, whence) SCM offset; SCM whence; { - scm_lseek (object, offset, whence); + scm_seek (object, offset, whence); return SCM_UNSPECIFIED; } diff --git a/libguile/ports.c b/libguile/ports.c index 66ff9c14c..a384b4852 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -978,9 +978,9 @@ scm_unread_string (str, port) return str; } -SCM_PROC (s_lseek, "lseek", 3, 0, 0, scm_lseek); +SCM_PROC (s_seek, "seek", 3, 0, 0, scm_seek); SCM -scm_lseek (SCM object, SCM offset, SCM whence) +scm_seek (SCM object, SCM offset, SCM whence) { off_t off; off_t rv; @@ -988,18 +988,18 @@ scm_lseek (SCM object, SCM offset, SCM whence) object = SCM_COERCE_OUTPORT (object); - off = scm_num2long (offset, (char *)SCM_ARG2, s_lseek); - SCM_ASSERT (SCM_INUMP (whence), whence, SCM_ARG3, s_lseek); + off = scm_num2long (offset, (char *)SCM_ARG2, s_seek); + SCM_ASSERT (SCM_INUMP (whence), whence, SCM_ARG3, s_seek); how = SCM_INUM (whence); if (how != SEEK_SET && how != SEEK_CUR && how != SEEK_END) - scm_out_of_range (s_lseek, whence); + scm_out_of_range (s_seek, whence); if (SCM_NIMP (object) && SCM_OPPORTP (object)) { scm_port *pt = SCM_PTAB_ENTRY (object); scm_ptob_descriptor *ptob = scm_ptobs + SCM_PTOBNUM (object); if (!ptob->seek) - scm_misc_error (s_lseek, "port is not seekable", + scm_misc_error (s_seek, "port is not seekable", scm_cons (object, SCM_EOL)); else { @@ -1013,10 +1013,10 @@ scm_lseek (SCM object, SCM offset, SCM whence) } else /* file descriptor?. */ { - SCM_ASSERT (SCM_INUMP (object), object, SCM_ARG1, s_lseek); + SCM_ASSERT (SCM_INUMP (object), object, SCM_ARG1, s_seek); rv = lseek (SCM_INUM (object), off, how); if (rv == -1) - scm_syserror (s_lseek); + scm_syserror (s_seek); } return scm_long2num (rv); } @@ -1037,7 +1037,7 @@ scm_truncate_file (SCM object, SCM length) if (SCM_NIMP (object) && SCM_ROSTRINGP (object)) scm_wrong_num_args (scm_makfrom0str (s_truncate_file)); - length = scm_lseek (object, SCM_INUM0, SCM_MAKINUM (SEEK_CUR)); + length = scm_seek (object, SCM_INUM0, SCM_MAKINUM (SEEK_CUR)); } c_length = scm_num2long (length, (char *)SCM_ARG2, s_truncate_file); if (c_length < 0) -- 2.20.1