summaryrefslogtreecommitdiff
path: root/functions.h
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2023-04-08 17:36:49 +0200
committerLuke Bratch <luke@bratch.co.uk>2023-04-08 17:36:49 +0200
commitca8c31cdb180bd5758a4a4f9d868eca31197081c (patch)
tree3aed35a062e426188642ed8e44a0ab4e8a64a0af /functions.h
parentd151ca51f94be04d8e70f72773e073a471a799de (diff)
Improve stdin handling (only available when running in foreground mode) - don't get stuck in a loop when handling EOF/^D/Ctrl+D, improve debug output, improve comments, initialise variables more safely, exit main loop on errors.
Diffstat (limited to 'functions.h')
-rw-r--r--functions.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/functions.h b/functions.h
index 5799aa6..30ae4e4 100644
--- a/functions.h
+++ b/functions.h
@@ -62,7 +62,8 @@
// Debug is only written if the global int "debug" is greater than or equal to the level.
void debugprint(int level, char *format, ...);
-// Get stdin line with buffer overrun protection
+// Get stdin line with buffer overrun protection.
+// Returns OK, NO_INPUT, or TOO_LONG as appropriate.
int getstdin(char *prompt, char *buff, size_t sz);
// Append CR-LF to the end of a string (after cleaning up any existing trailing CR or LF)