aboutsummaryrefslogtreecommitdiff
path: root/src/util.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-08-31 07:29:46 +0000
committer_ov4 <ov4@ov4.org>2026-08-31 07:29:46 +0000
commitb404880177a4eb9419a65fdf2536e42df36d524d (patch)
treebb7bd6e85414add09297feafa1b67ebcbb796980 /src/util.cc
parent60c1851b4ab92a5687af16ef566486e48813babc (diff)
eval
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/util.cc b/src/util.cc
index bd516e8..9574ce6 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -3,8 +3,7 @@
namespace ov4
{
-// constexpr int DECIMAL = 10;
-// constexpr int LENGTH = 25;
+using namespace std;
void atomic_print(char *s, bool ignore_wrap)
{
@@ -97,4 +96,23 @@ char *itoa(int num, char* str, int base)
return str;
}
+/*
+ * builtin_cmd - If the user has typed a built-in command then execute
+ * it immediately.
+ */
+int builtin_cmd(char *c_str)
+{
+ string s(c_str);
+ for (auto c : builtin_cmd_list)
+ if (c == s)
+ return 1;
+ return 0; /* not a builtin command */
+}
+
+void builtin_command_quit()
+{
+ exit(0);
+}
+
+
}