summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorAntoine ELIAS <antoine.elias@esi-group.com>2021-05-26 09:51:39 +0200
committerAntoine ELIAS <antoine.elias@esi-group.com>2021-05-26 09:51:39 +0200
commiteede300463cf6367f65f83b3c72481f3d80c3c38 (patch)
tree00fa9edf532c6a35b7b3ab4884617a5eb86a3058 /scilab
parentf8ff9927f796d2c03a03becb11a240a2f98242d2 (diff)
downloadscilab-eede300463cf6367f65f83b3c72481f3d80c3c38.zip
scilab-eede300463cf6367f65f83b3c72481f3d80c3c38.tar.gz
add function to get scilab version as string and revision
Change-Id: Ide9b3758286db1876116050aa21a816a9e68f064
Diffstat (limited to 'scilab')
-rw-r--r--scilab/modules/core/includes/getversion.h11
-rw-r--r--scilab/modules/core/src/c/getversion.c15
2 files changed, 25 insertions, 1 deletions
diff --git a/scilab/modules/core/includes/getversion.h b/scilab/modules/core/includes/getversion.h
index 038ab6f..236690b 100644
--- a/scilab/modules/core/includes/getversion.h
+++ b/scilab/modules/core/includes/getversion.h
@@ -55,6 +55,17 @@ int getScilabVersionMaintenance();
55int getScilabVersionTimestamp(); 55int getScilabVersionTimestamp();
56 56
57/** 57/**
58* get Scilab version revision
59* @return scilab version revision
60*/
61char* getScilabVersionRevision();
62
63/**
64* get Scilab version number as string
65* @return scilab version number as string
66*/
67char* getScilabVersionNumberAsString();
68 /**
58* get Scilab version as a string 69* get Scilab version as a string
59* @return scilab version 70* @return scilab version
60*/ 71*/
diff --git a/scilab/modules/core/src/c/getversion.c b/scilab/modules/core/src/c/getversion.c
index 9043503..a3d49b7 100644
--- a/scilab/modules/core/src/c/getversion.c
+++ b/scilab/modules/core/src/c/getversion.c
@@ -14,6 +14,7 @@
14*/ 14*/
15/*--------------------------------------------------------------------------*/ 15/*--------------------------------------------------------------------------*/
16#include <string.h> 16#include <string.h>
17#include <stdio.h>
17#include "getversion.h" 18#include "getversion.h"
18#include "version.h" 19#include "version.h"
19#include "configvariable_interface.h" 20#include "configvariable_interface.h"
@@ -91,7 +92,19 @@ int getScilabVersionTimestamp()
91 return (int)SCI_VERSION_TIMESTAMP; 92 return (int)SCI_VERSION_TIMESTAMP;
92} 93}
93/*--------------------------------------------------------------------------*/ 94/*--------------------------------------------------------------------------*/
94int* getModuleVersion(wchar_t* _pwstModule, int *sizeArrayReturned) 95char* getScilabVersionRevision()
96{
97 return os_strdup(SCI_VERSION_REVISION);
98}
99/*--------------------------------------------------------------------------*/
100char* getScilabVersionNumberAsString()
101{
102 char version[16] = {0};
103 sprintf(version, "%d.%d.%d", getScilabVersionMajor(), getScilabVersionMinor(), getScilabVersionMaintenance());
104 return os_strdup(version);
105}
106/*--------------------------------------------------------------------------*/
107int* getModuleVersion(wchar_t* _pwstModule, int* sizeArrayReturned)
95{ 108{
96 int *returnedArray = NULL; 109 int *returnedArray = NULL;
97 110