1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 21:10:27 +02:00

* ioext.c, ioext.h: remove obsolete _sys_ from 9 procedure names.

*	* posix.c (scm_fork): Scheme name changed from fork to primitive-fork,
	to avoid clash with various scsh forks.
This commit is contained in:
Gary Houston 1997-01-31 04:36:24 +00:00
parent ad31050811
commit 063e05bed8
4 changed files with 64 additions and 58 deletions

View file

@ -1,3 +1,10 @@
Fri Jan 31 04:33:11 1997 Gary Houston <ghouston@actrix.gen.nz>
* ioext.c, ioext.h: remove obsolete _sys_ from 9 procedure names.
* * posix.c (scm_fork): Scheme name changed from fork to primitive-fork,
to avoid clash with various scsh forks.
Thu Jan 30 20:14:09 1997 Mikael Djurfeldt <mdj@syk-0606.pdc.kth.se> Thu Jan 30 20:14:09 1997 Mikael Djurfeldt <mdj@syk-0606.pdc.kth.se>
The following two changes (ramap.c, throw.c) are motivated by the The following two changes (ramap.c, throw.c) are motivated by the

View file

@ -150,17 +150,17 @@ scm_write_line (obj, port)
return scm_newline (port); return scm_newline (port);
} }
SCM_PROC (s_sys_ftell, "ftell", 1, 0, 0, scm_sys_ftell); SCM_PROC (s_ftell, "ftell", 1, 0, 0, scm_ftell);
SCM SCM
scm_sys_ftell (port) scm_ftell (port)
SCM port; SCM port;
{ {
long pos; long pos;
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_ftell); SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_ftell);
SCM_SYSCALL (pos = ftell ((FILE *)SCM_STREAM (port))); SCM_SYSCALL (pos = ftell ((FILE *)SCM_STREAM (port)));
if (pos < 0) if (pos < 0)
scm_syserror (s_sys_ftell); scm_syserror (s_ftell);
if (pos > 0 && SCM_CRDYP (port)) if (pos > 0 && SCM_CRDYP (port))
pos--; pos--;
return scm_long2num (pos); return scm_long2num (pos);
@ -168,10 +168,10 @@ scm_sys_ftell (port)
SCM_PROC (s_sys_fseek, "fseek", 3, 0, 0, scm_sys_fseek); SCM_PROC (s_fseek, "fseek", 3, 0, 0, scm_fseek);
SCM SCM
scm_sys_fseek (port, offset, whence) scm_fseek (port, offset, whence)
SCM port; SCM port;
SCM offset; SCM offset;
SCM whence; SCM whence;
@ -179,34 +179,34 @@ scm_sys_fseek (port, offset, whence)
int rv; int rv;
long loff; long loff;
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_fseek); SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_fseek);
loff = scm_num2long (offset, (char *)SCM_ARG2, s_sys_fseek); loff = scm_num2long (offset, (char *)SCM_ARG2, s_fseek);
SCM_ASSERT (SCM_INUMP (whence) && (SCM_INUM (whence) < 3) && (SCM_INUM (whence) >= 0), SCM_ASSERT (SCM_INUMP (whence) && (SCM_INUM (whence) < 3) && (SCM_INUM (whence) >= 0),
whence, SCM_ARG3, s_sys_fseek); whence, SCM_ARG3, s_fseek);
SCM_CLRDY (port); /* Clear ungetted char */ SCM_CLRDY (port); /* Clear ungetted char */
/* Values of whence are interned in scm_init_ioext. */ /* Values of whence are interned in scm_init_ioext. */
rv = fseek ((FILE *)SCM_STREAM (port), loff, SCM_INUM (whence)); rv = fseek ((FILE *)SCM_STREAM (port), loff, SCM_INUM (whence));
if (rv != 0) if (rv != 0)
scm_syserror (s_sys_fseek); scm_syserror (s_fseek);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
SCM_PROC (s_sys_freopen, "freopen", 3, 0, 0, scm_sys_freopen); SCM_PROC (s_freopen, "freopen", 3, 0, 0, scm_freopen);
SCM SCM
scm_sys_freopen (filename, modes, port) scm_freopen (filename, modes, port)
SCM filename; SCM filename;
SCM modes; SCM modes;
SCM port; SCM port;
{ {
FILE *f; FILE *f;
SCM_ASSERT (SCM_NIMP (filename) && SCM_STRINGP (filename), filename, SCM_ARG1, s_sys_freopen); SCM_ASSERT (SCM_NIMP (filename) && SCM_STRINGP (filename), filename, SCM_ARG1, s_freopen);
SCM_ASSERT (SCM_NIMP (modes) && SCM_STRINGP (modes), modes, SCM_ARG2, s_sys_freopen); SCM_ASSERT (SCM_NIMP (modes) && SCM_STRINGP (modes), modes, SCM_ARG2, s_freopen);
SCM_DEFER_INTS; SCM_DEFER_INTS;
SCM_ASSERT (SCM_NIMP (port) && SCM_FPORTP (port), port, SCM_ARG3, s_sys_freopen); SCM_ASSERT (SCM_NIMP (port) && SCM_FPORTP (port), port, SCM_ARG3, s_freopen);
SCM_SYSCALL (f = freopen (SCM_CHARS (filename), SCM_CHARS (modes), (FILE *)SCM_STREAM (port))); SCM_SYSCALL (f = freopen (SCM_CHARS (filename), SCM_CHARS (modes), (FILE *)SCM_STREAM (port)));
if (!f) if (!f)
{ {
@ -230,10 +230,10 @@ scm_sys_freopen (filename, modes, port)
SCM_PROC (s_sys_duplicate_port, "duplicate-port", 2, 0, 0, scm_sys_duplicate_port); SCM_PROC (s_duplicate_port, "duplicate-port", 2, 0, 0, scm_duplicate_port);
SCM SCM
scm_sys_duplicate_port (oldpt, modes) scm_duplicate_port (oldpt, modes)
SCM oldpt; SCM oldpt;
SCM modes; SCM modes;
{ {
@ -241,21 +241,21 @@ scm_sys_duplicate_port (oldpt, modes)
int newfd; int newfd;
FILE *f; FILE *f;
SCM newpt; SCM newpt;
SCM_ASSERT (SCM_NIMP (oldpt) && SCM_OPPORTP (oldpt), oldpt, SCM_ARG1, s_sys_duplicate_port); SCM_ASSERT (SCM_NIMP (oldpt) && SCM_OPPORTP (oldpt), oldpt, SCM_ARG1, s_duplicate_port);
SCM_ASSERT (SCM_NIMP (modes) && SCM_STRINGP (modes), modes, SCM_ARG2, s_sys_duplicate_port); SCM_ASSERT (SCM_NIMP (modes) && SCM_STRINGP (modes), modes, SCM_ARG2, s_duplicate_port);
SCM_NEWCELL (newpt); SCM_NEWCELL (newpt);
SCM_DEFER_INTS; SCM_DEFER_INTS;
oldfd = fileno ((FILE *)SCM_STREAM (oldpt)); oldfd = fileno ((FILE *)SCM_STREAM (oldpt));
if (oldfd == -1) if (oldfd == -1)
scm_syserror (s_sys_duplicate_port); scm_syserror (s_duplicate_port);
SCM_SYSCALL (newfd = dup (oldfd)); SCM_SYSCALL (newfd = dup (oldfd));
if (newfd == -1) if (newfd == -1)
scm_syserror (s_sys_duplicate_port); scm_syserror (s_duplicate_port);
f = fdopen (newfd, SCM_CHARS (modes)); f = fdopen (newfd, SCM_CHARS (modes));
if (!f) if (!f)
{ {
SCM_SYSCALL (close (newfd)); SCM_SYSCALL (close (newfd));
scm_syserror (s_sys_duplicate_port); scm_syserror (s_duplicate_port);
} }
{ {
struct scm_port_table * pt; struct scm_port_table * pt;
@ -273,65 +273,65 @@ scm_sys_duplicate_port (oldpt, modes)
SCM_PROC (s_sys_redirect_port, "redirect-port", 2, 0, 0, scm_sys_redirect_port); SCM_PROC (s_redirect_port, "redirect-port", 2, 0, 0, scm_redirect_port);
SCM SCM
scm_sys_redirect_port (into_pt, from_pt) scm_redirect_port (into_pt, from_pt)
SCM into_pt; SCM into_pt;
SCM from_pt; SCM from_pt;
{ {
int ans, oldfd, newfd; int ans, oldfd, newfd;
SCM_DEFER_INTS; SCM_DEFER_INTS;
SCM_ASSERT (SCM_NIMP (into_pt) && SCM_OPPORTP (into_pt), into_pt, SCM_ARG1, s_sys_redirect_port); SCM_ASSERT (SCM_NIMP (into_pt) && SCM_OPPORTP (into_pt), into_pt, SCM_ARG1, s_redirect_port);
SCM_ASSERT (SCM_NIMP (from_pt) && SCM_OPPORTP (from_pt), from_pt, SCM_ARG2, s_sys_redirect_port); SCM_ASSERT (SCM_NIMP (from_pt) && SCM_OPPORTP (from_pt), from_pt, SCM_ARG2, s_redirect_port);
oldfd = fileno ((FILE *)SCM_STREAM (into_pt)); oldfd = fileno ((FILE *)SCM_STREAM (into_pt));
if (oldfd == -1) if (oldfd == -1)
scm_syserror (s_sys_redirect_port); scm_syserror (s_redirect_port);
newfd = fileno ((FILE *)SCM_STREAM (from_pt)); newfd = fileno ((FILE *)SCM_STREAM (from_pt));
if (newfd == -1) if (newfd == -1)
scm_syserror (s_sys_redirect_port); scm_syserror (s_redirect_port);
SCM_SYSCALL (ans = dup2 (oldfd, newfd)); SCM_SYSCALL (ans = dup2 (oldfd, newfd));
if (ans == -1) if (ans == -1)
scm_syserror (s_sys_redirect_port); scm_syserror (s_redirect_port);
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
SCM_PROC (s_sys_fileno, "fileno", 1, 0, 0, scm_sys_fileno); SCM_PROC (s_fileno, "fileno", 1, 0, 0, scm_fileno);
SCM SCM
scm_sys_fileno (port) scm_fileno (port)
SCM port; SCM port;
{ {
int fd; int fd;
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_fileno); SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_fileno);
fd = fileno ((FILE *)SCM_STREAM (port)); fd = fileno ((FILE *)SCM_STREAM (port));
if (fd == -1) if (fd == -1)
scm_syserror (s_sys_fileno); scm_syserror (s_fileno);
return SCM_MAKINUM (fd); return SCM_MAKINUM (fd);
} }
SCM_PROC (s_sys_isatty, "isatty?", 1, 0, 0, scm_sys_isatty_p); SCM_PROC (s_isatty, "isatty?", 1, 0, 0, scm_isatty_p);
SCM SCM
scm_sys_isatty_p (port) scm_isatty_p (port)
SCM port; SCM port;
{ {
int rv; int rv;
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_isatty); SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_isatty);
rv = fileno ((FILE *)SCM_STREAM (port)); rv = fileno ((FILE *)SCM_STREAM (port));
if (rv == -1) if (rv == -1)
scm_syserror (s_sys_isatty); scm_syserror (s_isatty);
rv = isatty (rv); rv = isatty (rv);
return rv ? SCM_BOOL_T : SCM_BOOL_F; return rv ? SCM_BOOL_T : SCM_BOOL_F;
} }
SCM_PROC (s_sys_fdopen, "fdopen", 2, 0, 0, scm_sys_fdopen); SCM_PROC (s_fdopen, "fdopen", 2, 0, 0, scm_fdopen);
SCM SCM
scm_sys_fdopen (fdes, modes) scm_fdopen (fdes, modes)
SCM fdes; SCM fdes;
SCM modes; SCM modes;
{ {
@ -339,13 +339,13 @@ scm_sys_fdopen (fdes, modes)
SCM port; SCM port;
struct scm_port_table * pt; struct scm_port_table * pt;
SCM_ASSERT (SCM_INUMP (fdes), fdes, SCM_ARG1, s_sys_fdopen); SCM_ASSERT (SCM_INUMP (fdes), fdes, SCM_ARG1, s_fdopen);
SCM_ASSERT (SCM_NIMP (modes) && SCM_STRINGP (modes), modes, SCM_ARG2, s_sys_fdopen); SCM_ASSERT (SCM_NIMP (modes) && SCM_STRINGP (modes), modes, SCM_ARG2, s_fdopen);
SCM_NEWCELL (port); SCM_NEWCELL (port);
SCM_DEFER_INTS; SCM_DEFER_INTS;
f = fdopen (SCM_INUM (fdes), SCM_CHARS (modes)); f = fdopen (SCM_INUM (fdes), SCM_CHARS (modes));
if (f == NULL) if (f == NULL)
scm_syserror (s_sys_fdopen); scm_syserror (s_fdopen);
pt = scm_add_to_port_table (port); pt = scm_add_to_port_table (port);
SCM_SETPTAB_ENTRY (port, pt); SCM_SETPTAB_ENTRY (port, pt);
SCM_SETCAR (port, scm_tc16_fport | scm_mode_bits (SCM_CHARS (modes))); SCM_SETCAR (port, scm_tc16_fport | scm_mode_bits (SCM_CHARS (modes)));
@ -363,10 +363,10 @@ scm_sys_fdopen (fdes, modes)
* #t if fdes moved. * #t if fdes moved.
* MOVE->FDES is implemented in Scheme and calls this primitive. * MOVE->FDES is implemented in Scheme and calls this primitive.
*/ */
SCM_PROC (s_sys_primitive_move_to_fdes, "primitive-move->fdes", 2, 0, 0, scm_sys_primitive_move_to_fdes); SCM_PROC (s_primitive_move_to_fdes, "primitive-move->fdes", 2, 0, 0, scm_primitive_move_to_fdes);
SCM SCM
scm_sys_primitive_move_to_fdes (port, fd) scm_primitive_move_to_fdes (port, fd)
SCM port; SCM port;
SCM fd; SCM fd;
{ {
@ -375,8 +375,8 @@ scm_sys_primitive_move_to_fdes (port, fd)
int new_fd; int new_fd;
int rv; int rv;
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_sys_primitive_move_to_fdes); SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_primitive_move_to_fdes);
SCM_ASSERT (SCM_INUMP (fd), fd, SCM_ARG2, s_sys_primitive_move_to_fdes); SCM_ASSERT (SCM_INUMP (fd), fd, SCM_ARG2, s_primitive_move_to_fdes);
SCM_DEFER_INTS; SCM_DEFER_INTS;
stream = (FILE *)SCM_STREAM (port); stream = (FILE *)SCM_STREAM (port);
old_fd = fileno (stream); old_fd = fileno (stream);
@ -389,7 +389,7 @@ scm_sys_primitive_move_to_fdes (port, fd)
scm_evict_ports (new_fd); scm_evict_ports (new_fd);
rv = dup2 (old_fd, new_fd); rv = dup2 (old_fd, new_fd);
if (rv == -1) if (rv == -1)
scm_syserror (s_sys_primitive_move_to_fdes); scm_syserror (s_primitive_move_to_fdes);
scm_setfileno (stream, new_fd); scm_setfileno (stream, new_fd);
SCM_SYSCALL (close (old_fd)); SCM_SYSCALL (close (old_fd));
SCM_ALLOW_INTS; SCM_ALLOW_INTS;

View file

@ -50,15 +50,15 @@
extern SCM scm_read_delimited_x SCM_P ((SCM delims, SCM buf, SCM gobble, SCM port, SCM offset, SCM length)); extern SCM scm_read_delimited_x SCM_P ((SCM delims, SCM buf, SCM gobble, SCM port, SCM offset, SCM length));
extern SCM scm_write_line SCM_P ((SCM obj, SCM port)); extern SCM scm_write_line SCM_P ((SCM obj, SCM port));
extern SCM scm_sys_ftell SCM_P ((SCM port)); extern SCM scm_ftell SCM_P ((SCM port));
extern SCM scm_sys_fseek SCM_P ((SCM port, SCM offset, SCM whence)); extern SCM scm_fseek SCM_P ((SCM port, SCM offset, SCM whence));
extern SCM scm_sys_freopen SCM_P ((SCM filename, SCM modes, SCM port)); extern SCM scm_freopen SCM_P ((SCM filename, SCM modes, SCM port));
extern SCM scm_sys_duplicate_port SCM_P ((SCM oldpt, SCM modes)); extern SCM scm_duplicate_port SCM_P ((SCM oldpt, SCM modes));
extern SCM scm_sys_redirect_port SCM_P ((SCM into_pt, SCM from_pt)); extern SCM scm_redirect_port SCM_P ((SCM into_pt, SCM from_pt));
extern SCM scm_sys_fileno SCM_P ((SCM port)); extern SCM scm_fileno SCM_P ((SCM port));
extern SCM scm_sys_isatty_p SCM_P ((SCM port)); extern SCM scm_isatty_p SCM_P ((SCM port));
extern SCM scm_sys_fdopen SCM_P ((SCM fdes, SCM modes)); extern SCM scm_fdopen SCM_P ((SCM fdes, SCM modes));
extern SCM scm_sys_primitive_move_to_fdes SCM_P ((SCM port, SCM fd)); extern SCM scm_primitive_move_to_fdes SCM_P ((SCM port, SCM fd));
extern void scm_setfileno SCM_P ((FILE *fs, int fd)); extern void scm_setfileno SCM_P ((FILE *fs, int fd));
extern void scm_evict_ports SCM_P ((int fd)); extern void scm_evict_ports SCM_P ((int fd));
extern SCM scm_fdes_to_ports SCM_P ((SCM fd)); extern SCM scm_fdes_to_ports SCM_P ((SCM fd));

View file

@ -750,8 +750,7 @@ scm_execlp (args)
return SCM_BOOL_F; return SCM_BOOL_F;
} }
/* Flushing streams etc., is not done here. */ SCM_PROC (s_fork, "primitive-fork", 0, 0, 0, scm_fork);
SCM_PROC (s_fork, "fork", 0, 0, 0, scm_fork);
SCM SCM
scm_fork() scm_fork()