summaryrefslogtreecommitdiff
path: root/sci_gateway/cpp/sci_sym_isenvactive.cpp
diff options
context:
space:
mode:
authorHarpreet2015-08-27 02:32:30 +0530
committerHarpreet2015-08-27 02:32:30 +0530
commitf9afc284ce324fa3c13606ad90895beec507c249 (patch)
treea1680fec3342c4eb00b73cd056ff9fad519c5877 /sci_gateway/cpp/sci_sym_isenvactive.cpp
downloadsymphony-f9afc284ce324fa3c13606ad90895beec507c249.tar.gz
symphony-f9afc284ce324fa3c13606ad90895beec507c249.tar.bz2
symphony-f9afc284ce324fa3c13606ad90895beec507c249.zip
Master File
Diffstat (limited to 'sci_gateway/cpp/sci_sym_isenvactive.cpp')
-rw-r--r--sci_gateway/cpp/sci_sym_isenvactive.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/sci_gateway/cpp/sci_sym_isenvactive.cpp b/sci_gateway/cpp/sci_sym_isenvactive.cpp
new file mode 100644
index 0000000..96d5976
--- /dev/null
+++ b/sci_gateway/cpp/sci_sym_isenvactive.cpp
@@ -0,0 +1,47 @@
+/*
+ * Symphony Toolbox
+ * Check if Symphony environment is active
+ * Made by Keyur Joshi
+ */
+#include "symphony.h"
+#include "sci_iofunc.hpp"
+
+extern sym_environment* global_sym_env; //defined in globals.cpp
+
+extern "C" {
+#include "api_scilab.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "BOOL.h"
+#include <localization.h>
+
+int sci_sym_isEnvActive(char *fname){
+
+ //error management variable
+ SciErr sciErr;
+ int iRet;
+
+ //data declarations
+ double returnVal;
+
+ //code to check arguments and get them
+ CheckInputArgument(pvApiCtx,0,0) ;
+ CheckOutputArgument(pvApiCtx,1,1) ;
+
+ //code to process input
+ if(global_sym_env==NULL){
+ sciprint("Symphony environment is not initialized. Please run 'sym_open()' first.\n");
+ returnVal=0.0;
+ }else{
+ sciprint("Symphony environment is active and ready for use.\n");
+ returnVal=1.0;
+ }
+
+ //code to give output
+ if(returnDoubleToScilab(returnVal))
+ return 1;
+
+ return 0;
+}
+
+}