diff options
author | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-11-27 17:35:12 +0000 |
---|---|---|
committer | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-11-27 17:35:12 +0000 |
commit | 93b629e504900432ea712cc3ed65dd937483e1c1 (patch) | |
tree | 61b56ecf7e8758620ab262c03a9be7d7867257d5 /src/ptycheck | |
parent | 37ba9d7cf61d6b9ddbfe59a4456311fda62ef101 (diff) | |
download | fpm-93b629e504900432ea712cc3ed65dd937483e1c1.tar.gz fpm-93b629e504900432ea712cc3ed65dd937483e1c1.zip |
Add: developer documentation to new files
Diffstat (limited to 'src/ptycheck')
-rw-r--r-- | src/ptycheck/isatty.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ptycheck/isatty.c b/src/ptycheck/isatty.c index 61acee6..9b7f519 100644 --- a/src/ptycheck/isatty.c +++ b/src/ptycheck/isatty.c @@ -1,10 +1,17 @@ +// This file provides a `c_isatty` wrapper function to check if `stdout` is connected
+// to a terminal or not. This wrapper is required for better portability, specifically
+// for supporting the MS Windows command prompt and the MinTTY terminal used by MSYS2.
+
#include <unistd.h> //for isatty()
#include <stdio.h> //for fileno()
#ifdef __MINGW64__
+// ptycheck/iscygpty allows us to check if connected to MinTTY in MSYS2 on Windows
#include "iscygpty.h"
#endif
+// Check if `stdout` is connected to a terminal
+// Returns 1 if is a terminal, and 0 otherwise
int c_isatty(void)
{
|