aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-06-28 05:02:14 +0000
committerdos-reis <gdr@axiomatics.org>2013-06-28 05:02:14 +0000
commit50ec7502934e4632348f4c3c8e060181f199dfc8 (patch)
treecd60fa76d27d654344f093a326222ff21685701b /src/gui
parentb52f0164b18f06db386d527be26e3a11deb1ab7d (diff)
downloadopen-axiom-50ec7502934e4632348f4c3c8e060181f199dfc8.tar.gz
Add src/rt for core runtime support.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.pro.in3
-rw-r--r--src/gui/main-window.cc21
-rw-r--r--src/gui/server.cc6
-rw-r--r--src/gui/server.h2
4 files changed, 8 insertions, 24 deletions
diff --git a/src/gui/gui.pro.in b/src/gui/gui.pro.in
index d118c08c..c67666d6 100644
--- a/src/gui/gui.pro.in
+++ b/src/gui/gui.pro.in
@@ -9,6 +9,7 @@ OA_INC = $${oa_targetdir}/include
OA_LIB = -L@top_builddir@/@target@/lib -lOpenAxiom
OA_IOLIB = -L@top_builddir@/src/io -lio
OA_SYNTAX_LIB = -L@top_builddir@/src/syntax -lsyntax
+OA_RT_LIB = -L@top_builddir@/src/rt -lruntime
## We build in release mode.
CONFIG += release
@@ -39,7 +40,7 @@ DEPENDPATH += @srcdir@
SOURCES += server.cc conversation.cc main-window.cc debate.cc main.cc
## Additional support libraries
-LIBS += $$OA_SYNTAX_LIB $$OA_LIB $$OA_IOLIB
+LIBS += $$OA_RT_LIB $$OA_SYNTAX_LIB $$OA_LIB $$OA_IOLIB
## C++ compiler
#QMAKE_CXX = @CXX@
diff --git a/src/gui/main-window.cc b/src/gui/main-window.cc
index 9c4969b0..ef9ad95b 100644
--- a/src/gui/main-window.cc
+++ b/src/gui/main-window.cc
@@ -36,9 +36,6 @@
#include <QMessageBox>
#include <QScrollBar>
-#include <open-axiom/diagnostics>
-#include <open-axiom/sexpr>
-#include <open-axiom/FileMapping>
#include "debate.h"
#include "main-window.h"
@@ -50,24 +47,6 @@ namespace OpenAxiom {
void
MainWindow::read_databases() {
- try {
- const auto& fs = server()->system_root();
- Memory::FileMapping db { fs.dbdir() + "/interp.daase" };
- Sexpr::Reader rd { db.begin(), db.end() };
- auto header = server()->lisp()->make_value(rd.read());
- if (auto p = Lisp::to_pair_if_can(header)) {
- auto offset = Lisp::retract_to_fixnum(p->head);
- rd.position(offset);
- auto table = server()->lisp()->toplevel_form(rd.read());
- }
- else {
- QMessageBox::critical(this, tr("Malformed Database Header"),
- QString(Lisp::show(header).c_str()));
- }
- }
- catch(const Diagnostics::BasicError& e) {
- display_error(e.message());
- }
}
diff --git a/src/gui/server.cc b/src/gui/server.cc
index 32f7ade7..7af0aa7c 100644
--- a/src/gui/server.cc
+++ b/src/gui/server.cc
@@ -41,8 +41,10 @@ namespace OpenAxiom {
}
Server::Server(int argc, char* argv[])
- : cmd(process_arguments(argc, argv)), fs(cmd.root_dir) {
- }
+ : cmd(process_arguments(argc, argv)),
+ fs(cmd.root_dir),
+ interp_db(fs.dbdir() + "/interp.daase")
+ { }
Server::~Server() {
if (state() == QProcess::Running)
diff --git a/src/gui/server.h b/src/gui/server.h
index b6a63dc5..e8ec3b11 100644
--- a/src/gui/server.h
+++ b/src/gui/server.h
@@ -36,6 +36,7 @@
#include <QProcess>
#include "open-axiom.h"
#include <open-axiom/Lisp>
+#include <open-axiom/Database>
namespace OpenAxiom {
struct Server : QProcess {
@@ -52,6 +53,7 @@ namespace OpenAxiom {
Command cmd;
Filesystem fs;
Lisp::Evaluator lsp;
+ VM::Database interp_db;
Server(const Server&) = delete;
Server& operator=(const Server&) = delete;