Line | |
---|
1 | #include "dietstdio.h" |
---|
2 | #include <unistd.h> |
---|
3 | |
---|
4 | static char __stdin_buf[BUFSIZE]; |
---|
5 | static FILE __stdin = { |
---|
6 | .fd=0, |
---|
7 | .flags=BUFINPUT|BUFLINEWISE|STATICBUF|CANREAD, |
---|
8 | .bs=0, .bm=0, |
---|
9 | .buflen=BUFSIZE, |
---|
10 | .buf=__stdin_buf, |
---|
11 | .next=0, |
---|
12 | .popen_kludge=0, |
---|
13 | .ungetbuf=0, |
---|
14 | .ungotten=0, |
---|
15 | #ifdef WANT_THREAD_SAFE |
---|
16 | .m=PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, |
---|
17 | #endif |
---|
18 | }; |
---|
19 | |
---|
20 | int __stdin_is_tty() { |
---|
21 | static int iknow; |
---|
22 | if (!iknow) iknow=isatty(0)+1; |
---|
23 | return (iknow-1); |
---|
24 | } |
---|
25 | |
---|
26 | FILE *stdin=&__stdin; |
---|
27 | |
---|
28 | int __fflush_stdin(void) { |
---|
29 | return fflush(stdin); |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.