aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-08-31 07:33:20 +0000
committer_ov4 <ov4@ov4.org>2026-08-31 07:33:20 +0000
commit3630075d034a69826c380e5cb70301d5b97557d3 (patch)
treeb48bd48b78476ae4d7243773598f51377f530b2e
parentb404880177a4eb9419a65fdf2536e42df36d524d (diff)
eval
-rw-r--r--include/eval.h7
-rw-r--r--include/global.h5
-rw-r--r--src/global.cc3
-rw-r--r--src/main.cc8
4 files changed, 15 insertions, 8 deletions
diff --git a/include/eval.h b/include/eval.h
index 6b0d1fa..bd3912c 100644
--- a/include/eval.h
+++ b/include/eval.h
@@ -18,3 +18,10 @@
#include "job.h"
#include "ground.h"
#include "parse.h"
+
+namespace ov4
+{
+
+void eval(char *cmdline);
+
+}
diff --git a/include/global.h b/include/global.h
index ee1141e..7d63c1b 100644
--- a/include/global.h
+++ b/include/global.h
@@ -1,11 +1,16 @@
#pragma once
+#include <vector>
+#include <string>
+
namespace ov4
{
+
extern int verbose;
constexpr int MAXLINE = 1024;
constexpr int MAXARGS = 128;
+extern std::vector<std::string> builtin_cmd_list;
}
diff --git a/src/global.cc b/src/global.cc
index e2a17ab..5b92331 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -3,6 +3,9 @@
namespace ov4
{
+using namespace std;
+
int verbose = 0;
+vector<string> builtin_cmd_list = {"quit", "fg", "bg", "jobs"};
}
diff --git a/src/main.cc b/src/main.cc
index 4d89e6e..f6c5477 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -50,14 +50,6 @@ char sbuf[MAXLINE]; /* for composing sprintf messages */
-
-vector<string> builtin_cmd_list = {"quit", "fg", "bg", "jobs"};
-/* End global variables */
-
-
-/* Function prototypes */
-
-/* Here are the functions that you will implement */
void eval(char *cmdline);
int builtin_cmd(char *c_str);