add function to get scilab version as string and revision 67/21767/1
Antoine ELIAS [Wed, 26 May 2021 07:51:39 +0000 (09:51 +0200)]
Change-Id: Ide9b3758286db1876116050aa21a816a9e68f064

scilab/modules/core/includes/getversion.h
scilab/modules/core/src/c/getversion.c

index 038ab6f..236690b 100644 (file)
@@ -55,6 +55,17 @@ int getScilabVersionMaintenance();
 int getScilabVersionTimestamp();
 
 /**
+* get Scilab version revision
+* @return scilab version revision
+*/
+char* getScilabVersionRevision();
+
+/**
+* get Scilab version number as string
+* @return scilab version number as string
+*/
+char* getScilabVersionNumberAsString();
+    /**
 * get Scilab version as a string
 * @return scilab version
 */
index 9043503..a3d49b7 100644 (file)
@@ -14,6 +14,7 @@
 */
 /*--------------------------------------------------------------------------*/
 #include <string.h>
+#include <stdio.h>
 #include "getversion.h"
 #include "version.h"
 #include "configvariable_interface.h"
@@ -91,7 +92,19 @@ int getScilabVersionTimestamp()
     return (int)SCI_VERSION_TIMESTAMP;
 }
 /*--------------------------------------------------------------------------*/
-int* getModuleVersion(wchar_t* _pwstModule, int *sizeArrayReturned)
+char* getScilabVersionRevision()
+{
+    return os_strdup(SCI_VERSION_REVISION);
+}
+/*--------------------------------------------------------------------------*/
+char* getScilabVersionNumberAsString()
+{
+    char version[16] = {0};
+    sprintf(version, "%d.%d.%d", getScilabVersionMajor(), getScilabVersionMinor(), getScilabVersionMaintenance());
+    return os_strdup(version);
+}
+/*--------------------------------------------------------------------------*/
+int* getModuleVersion(wchar_t* _pwstModule, int* sizeArrayReturned)
 {
     int *returnedArray = NULL;