summaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-07-02 09:55:01 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-07-05 16:04:33 +0200
commitb0b994896c22c0a55ef196bd186b42c7b189fadc (patch)
tree05f498571bd9d6da59cd1ba8ed3dfd4d86ec72ce /src/utils.c
parent2f8a4257564d0b96d7511574ea250363eb3b28a8 (diff)
downloadcalcurse-b0b994896c22c0a55ef196bd186b42c7b189fadc.zip
Add press_any_key() function
Displays "Press any key to continue..." in shell terminal mode and waits for a key stroke. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 5f19db0..a39b7df 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -813,3 +813,15 @@ child_wait (int *pfdin, int *pfdout, int pid)
waitpid (pid, &stat, 0);
return stat;
}
+
+/* Display "Press any key to continue..." and wait for a key press. */
+void
+press_any_key (void)
+{
+ fflush (stdout);
+ fputs (_("Press any key to continue..."), stdout);
+ fflush (stdout);
+ fgetc (stdin);
+ fflush (stdin);
+ fputs ("\r\n", stdout);
+}