diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2005-11-05 09:34:07 +0100 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2005-11-05 08:34:07 +0000 |
commit | 25fc05eb629e6befabbe5ed43510d91acf47562a (patch) | |
tree | 24d8f3b9b29d15f5a5b0db76b7d7bc01e309ac71 /libgfortran/intrinsics | |
parent | 5a522c1580b321aaf4e366d4c2495ded0b50a84a (diff) | |
download | gcc-25fc05eb629e6befabbe5ed43510d91acf47562a.zip gcc-25fc05eb629e6befabbe5ed43510d91acf47562a.tar.gz gcc-25fc05eb629e6befabbe5ed43510d91acf47562a.tar.bz2 |
intrinsic.c (add_functions): Add function version of TTYNAM.
* intrinsic.c (add_functions): Add function version of TTYNAM.
* intrinsic.h: Add prototypes for gfc_check_ttynam and
gfc_resolve_ttynam.
* gfortran.h: Add case for GFC_ISYM_TTYNAM.
* iresolve.c (gfc_resolve_ttynam): New function.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add a tree
for function call to library ttynam.
* check.c (gfc_check_ttynam): New function.
* trans-intrinsic.c (gfc_conv_intrinsic_ttynam): New function.
(): Call gfc_conv_intrinsic_ttynam.
* trans.h: Add prototype for gfor_fndecl_ttynam.
* intrinsics/tty.c (ttynam): New function.
From-SVN: r106522
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r-- | libgfortran/intrinsics/tty.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libgfortran/intrinsics/tty.c b/libgfortran/intrinsics/tty.c index 3a3d2bd..f4bfecd 100644 --- a/libgfortran/intrinsics/tty.c +++ b/libgfortran/intrinsics/tty.c @@ -31,6 +31,7 @@ Boston, MA 02110-1301, USA. */ #include "config.h" #include "libgfortran.h" #include "../io/io.h" + #include <string.h> /* LOGICAL FUNCTION ISATTY(UNIT) @@ -95,3 +96,28 @@ ttynam_sub (int *unit, char * name, gfc_charlen_type name_len) } } } + + +extern void ttynam (char **, gfc_charlen_type *, int); +export_proto(ttynam); + +void +ttynam (char ** name, gfc_charlen_type * name_len, int unit) +{ + gfc_unit *u; + + u = find_unit (unit); + if (u != NULL) + { + *name = stream_ttyname (u->s); + if (*name != NULL) + { + *name_len = strlen (*name); + *name = strdup (*name); + return; + } + } + + *name_len = 0; + *name = NULL; +} |