From c9c3b2f4357e30dd078075b3259d86adca6958e3 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 1 Sep 2026 06:21:08 +0000 Subject: 1 --- src/util/io.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/util') diff --git a/src/util/io.cc b/src/util/io.cc index 531bd47..1261684 100644 --- a/src/util/io.cc +++ b/src/util/io.cc @@ -96,4 +96,34 @@ char *itoa(int num, char* str, int base) return str; } +/* + * usage - print a help message + */ +void usage(void) +{ + printf("Usage: shell [-hvp]\n"); + printf(" -h print this message\n"); + printf(" -v print additional diagnostic information\n"); + printf(" -p do not emit a command prompt\n"); + exit(1); +} + +/* + * unix_error - unix-style error routine + */ +void unix_error(char *msg) +{ + fprintf(stdout, "%s: %s\n", msg, strerror(errno)); + exit(1); +} + +/* + * app_error - application-style error routine + */ +void app_error(char *msg) +{ + fprintf(stdout, "%s\n", msg); + exit(1); +} + } -- cgit v1.3.1-4-g156e