From b404880177a4eb9419a65fdf2536e42df36d524d Mon Sep 17 00:00:00 2001 From: _ov4 Date: Mon, 31 Aug 2026 07:29:46 +0000 Subject: eval --- src/util.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/util.cc') 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); +} + + } -- cgit v1.3.1-4-g156e