From ae8b87895f3ae2557674aad472f58efc2274440b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Coudert?= Date: Tue, 9 Aug 2005 17:33:17 +0000 Subject: check.c (gfc_check_ttynam_sub, [...]): Add check functions for new intrinsics TTYNAM and ISATTY. * check.c (gfc_check_ttynam_sub, gfc_check_isatty): Add check functions for new intrinsics TTYNAM and ISATTY. * intrinsic.c (add_functions, add_subroutines): Add new intrinsics. * intrinsic.h: Add prototypes for new check and resolve functions. * iresolve.c (gfc_resolve_isatty, gfc_resolve_ttynam_sub): New resolve functions for intrinsics TTYNAM and ISATTY. * gfortran.h (gfc_generic_isym_id): Add symbol for ISATTY. * trans-intrinsic.c: Add case for GFC_ISYM_ISATTY. * Makefile.am: Add file intrinsics/tty.c to Makefile process. * Makefile.in: Regenerate. * io/io.h: Prototypes for new functions stream_isatty and stream_ttyname. * io/unix (stream_isatty, stream_ttyname): New functions to call isatty() and ttyname() on a given unit. * intrinsics/tty.c: New file to implement g77 intrinsics TTYNAM and ISATTY. From-SVN: r102915 --- libgfortran/io/unix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libgfortran/io/unix.c') diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index e6b0478..eead2a2 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1536,6 +1536,18 @@ flush (stream *s) return fd_flush( (unix_stream *) s); } +int +stream_isatty (stream *s) +{ + return isatty (((unix_stream *) s)->fd); +} + +char * +stream_ttyname (stream *s) +{ + return ttyname (((unix_stream *) s)->fd); +} + /* How files are stored: This is an operating-system specific issue, and therefore belongs here. There are three cases to consider. -- cgit v1.1