Skip to content

Commit

Permalink
Update for new Main.mo interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Jan 30, 2018
1 parent 58c7969 commit ab34299
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 5 additions & 8 deletions OMNotebook/OMNotebookGUI/omcinteractiveenvironment.cpp
Expand Up @@ -53,15 +53,15 @@
#ifndef WIN32
#include "omc_config.h"
#endif
#include "gc.h"

extern "C" {
void (*omc_assert)(threadData_t*,FILE_INFO info,const char *msg,...) __attribute__((noreturn)) = omc_assert_function;
void (*omc_assert_warning)(FILE_INFO info,const char *msg,...) = omc_assert_warning_function;
void (*omc_terminate)(FILE_INFO info,const char *msg,...) = omc_terminate_function;
void (*omc_throw)(threadData_t*) __attribute__ ((noreturn)) = omc_throw_function;
int omc_Main_handleCommand(void *threadData, void *imsg, void *ist, void **omsg, void **ost);
int omc_Main_handleCommand(void *threadData, void *imsg, void **omsg);
void* omc_Main_init(void *threadData, void *args);
void* omc_Main_readSettings(void *threadData, void *args);
#ifdef WIN32
void omc_Main_setWindowsPaths(threadData_t *threadData, void* _inOMHome);
#endif
Expand Down Expand Up @@ -95,14 +95,11 @@ namespace IAEX
QString locale = "+locale=" + settingsLocale.name();
args = mmc_mk_cons(mmc_mk_scon(locale.toStdString().c_str()), args);
// initialize threadData
threadData_t *threadData = (threadData_t *) calloc(1, sizeof(threadData_t));
void *st = 0;
threadData_t *threadData = (threadData_t *) GC_malloc_uncollectable(sizeof(threadData_t));
MMC_TRY_TOP_INTERNAL()
omc_Main_init(threadData, args);
st = omc_Main_readSettings(threadData, mmc_mk_nil());
MMC_CATCH_TOP()
threadData_ = threadData;
symbolTable_ = st;
threadData_->plotClassPointer = 0;
threadData_->plotCB = 0;
// set the +d=initialization flag default.
Expand Down Expand Up @@ -170,14 +167,14 @@ namespace IAEX

MMC_TRY_STACK()

if (!omc_Main_handleCommand(threadData, mmc_mk_scon(expr.toStdString().c_str()), symbolTable_, &reply_str, &symbolTable_)) {
if (!omc_Main_handleCommand(threadData, mmc_mk_scon(expr.toStdString().c_str()), &reply_str)) {
return;
}
result_ = MMC_STRINGDATA(reply_str);
result_ = result_.trimmed();
reply_str = NULL;
// see if there are any errors if the expr is not "quit()"
if (!omc_Main_handleCommand(threadData, mmc_mk_scon("getErrorString()"), symbolTable_, &reply_str, &symbolTable_)) {
if (!omc_Main_handleCommand(threadData, mmc_mk_scon("getErrorString()"), &reply_str)) {
return;
}
error_ = MMC_STRINGDATA(reply_str);
Expand Down
1 change: 0 additions & 1 deletion OMNotebook/OMNotebookGUI/omcinteractiveenvironment.h
Expand Up @@ -48,7 +48,6 @@ namespace IAEX

public:
threadData_t *threadData_;
void *symbolTable_;

static OmcInteractiveEnvironment* getInstance();
virtual QString getResult();
Expand Down

0 comments on commit ab34299

Please sign in to comment.