summaryrefslogtreecommitdiffstats
path: root/matlab/mex/mexInitFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'matlab/mex/mexInitFunctions.cpp')
-rw-r--r--matlab/mex/mexInitFunctions.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/matlab/mex/mexInitFunctions.cpp b/matlab/mex/mexInitFunctions.cpp
index d8a50d7..7245af2 100644
--- a/matlab/mex/mexInitFunctions.cpp
+++ b/matlab/mex/mexInitFunctions.cpp
@@ -8,7 +8,7 @@ bool mexIsInitialized=false;
*
*/
void logCallBack(const char *msg, size_t len){
- mexPrintf(msg);
+ mexPrintf("%s",msg);
}
/**
@@ -17,8 +17,19 @@ void logCallBack(const char *msg, size_t len){
*/
void initASTRAMex(){
if(mexIsInitialized) return;
+
+ astra::running_in_matlab=true;
+
if(!astra::CLogger::setCallbackScreen(&logCallBack)){
mexErrMsgTxt("Error initializing mex functions.");
}
+
mexIsInitialized=true;
+
+
+ // If we have support for plugins, initialize them.
+ // (NB: Call this after setting mexIsInitialized, to avoid recursively
+ // calling initASTRAMex)
+ mexEvalString("if exist('astra_mex_plugin_c') == 3; astra_mex_plugin_c('init'); end");
+
}