-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (24 loc) · 664 Bytes
/
Copy pathmain.cpp
File metadata and controls
35 lines (24 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "zbase.h"
#include "zcode.h"
#include <QCoreApplication>
#include <QtConcurrent/QtConcurrentRun>
#include <QStack>
void begin(const char *fileName)
{
qRegisterMetaType<ZVariant>("ZVariant");
ZCode::virtualStack.reserve(50);
ZBase::init();
ZCodeExecuter *executer = ZCodeExecuter::beginCodeExecuter();
int quitCode = executer->eval(fileName);
ZCodeExecuter::endCodeExecuter();
delete executer;
qApp->exit(quitCode);
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
if(argc > 1) {
QtConcurrent::run(QThreadPool::globalInstance(), &begin, argv[1]);
}
return a.exec();;
}