aboutsummaryrefslogtreecommitdiff
path: root/src/isatty.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/isatty.c')
-rw-r--r--src/isatty.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/isatty.c b/src/isatty.c
new file mode 100644
index 0000000..bd0f74a
--- /dev/null
+++ b/src/isatty.c
@@ -0,0 +1,13 @@
+#include <unistd.h> //for isatty()
+#include <stdio.h> //for fileno()
+
+int c_isatty(void)
+{
+
+ if (isatty(fileno(stdin))){
+ return 1;
+ } else {
+ return 0;
+ }
+
+} \ No newline at end of file