We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16b0bf8 commit 70b5163Copy full SHA for 70b5163
Makefile
@@ -18,7 +18,7 @@
18
# LDLIBS - Linker libraries.
19
# TARGET - Output library name. #
20
#
21
-OS = FreeBSD
+OS = linux
22
PREFIX = /usr/local
23
FC = gfortran
24
CC = gcc
src/unix_macro.c
@@ -14,7 +14,7 @@ extern "C" {
14
int c_errno(void);
15
int c_execl(const char *, const char *, const char *, const char *, void *);
16
int c_fcntl(int, int, int);
17
-int c_fprintf(FILE *, const char *, const char *);
+int c_fprintf(void *, const char *, const char *);
int c_ioctl(int, unsigned long, void *);
int c_open(const char *, int, mode_t);
int c_scanf(const char *, const char *);
@@ -48,9 +48,9 @@ int c_fcntl(int fd, int cmd, int arg)
48
}
49
50
/* int fprintf(FILE *stream, const char *format, ...) */
51
-int c_fprintf(FILE *stream, const char *format, const char *arg)
+int c_fprintf(void *stream, const char *format, const char *arg)
52
{
53
- return fprintf(stream, format, arg);
+ return fprintf((FILE *) stream, format, arg);
54
55
56
/* int ioctl(int fd, unsigned long request, ...) */
src/unix_stdio.F90
@@ -24,6 +24,7 @@ module unix_stdio
#endif
25
26
public :: c_getchar
27
+ public :: c_getline
28
public :: c_fclose
29
public :: c_fdopen
30
public :: c_fflush
@@ -50,6 +51,16 @@ function c_getchar() bind(c, name='getchar')
integer(kind=c_int) :: c_getchar
end function c_getchar
+ ! ssize_t getline(char **lineptr, size_t *n, FILE *stream)
+ function c_getline(lineptr, n, stream) bind(c, name='getline')
+ import :: c_char, c_ptr, c_size_t
57
+ implicit none
58
+ type(c_ptr), intent(inout) :: lineptr
59
+ integer(kind=c_size_t), intent(inout) :: n
60
+ type(c_ptr), intent(in), value :: stream
61
+ integer(kind=c_size_t) :: c_getline
62
+ end function c_getline
63
+
64
! int fclose(FILE *stream)
65
function c_fclose(stream) bind(c, name='fclose')
66
import :: c_int, c_ptr
src/unix_unistd.F90
@@ -26,6 +26,7 @@ module unix_unistd
public :: c_faccessat
public :: c_fork
public :: c_getpid
+ public :: c_isatty
public :: c_pipe
31
public :: c_read
32
public :: c_setsid
@@ -113,6 +114,14 @@ function c_getpid() bind(c, name='getpid')
113
114
integer(kind=c_pid_t) :: c_getpid
115
end function c_getpid
116
117
+ ! int isatty(int fd)
118
+ function c_isatty(fd) bind(c, name='isatty')
119
+ import :: c_int
120
121
+ integer(kind=c_int), intent(in), value :: fd
122
+ integer(kind=c_int) :: c_isatty
123
+ end function c_isatty
124
125
! int pipe(int fd[2])
126
function c_pipe(fd) bind(c, name='pipe')
127
import :: c_int
0 commit comments