fix duplicate symbol between ast and fileio/scilab_windows 99/19499/3
Antoine ELIAS [Mon, 23 Oct 2017 13:08:15 +0000 (15:08 +0200)]
Change-Id: I3e792a92da876586db21990fb55785f6c5bc9b14

16 files changed:
scilab/modules/ast/fileio_Import.def
scilab/modules/ast/includes/system_env/setenvvar.h
scilab/modules/ast/src/cpp/system_env/sci_home.cpp
scilab/modules/ast/src/cpp/system_env/setenvvar.cpp
scilab/modules/call_scilab/src/c/call_scilab.c
scilab/modules/fileio/fileio.vcxproj.filters
scilab/modules/helptools/sci_gateway/cpp/sci_buildDoc.cpp
scilab/modules/tclsci/src/c/EnvTclTk.c
scilab/modules/windows_tools/includes/ConvertSlash.h [deleted file]
scilab/modules/windows_tools/src/c/scilab_windows/ConvertSlash.c [deleted file]
scilab/modules/windows_tools/src/c/scilab_windows/scilab_windows.vcxproj
scilab/modules/windows_tools/src/c/scilab_windows/scilab_windows.vcxproj.filters
scilab/modules/windows_tools/src/c/windows_tools.vcxproj
scilab/modules/windows_tools/src/c/windows_tools.vcxproj.filters
scilab/modules/windows_tools/src/cpp/scilab_windows/SetScilabEnvironmentVariables.cpp [deleted file]
scilab/modules/windows_tools/src/cpp/scilab_windows/SetScilabEnvironmentVariables.h [deleted file]

index 3567521..e5b157f 100644 (file)
@@ -8,3 +8,6 @@ getlongpathname
 FileExistW
 getfile_filename
 get_full_pathW
+isdir
+isDrive
+createdirectory
index d1d7544..3e86d23 100644 (file)
 #define UNIX_SEPATATOR '/'
 #define WINDOWS_SEPATATOR '\\'
 
-EXTERN_AST bool IsTheGoodShell(void);
-EXTERN_AST bool Set_Shell(void);
+EXTERN_AST BOOL IsTheGoodShell(void);
+EXTERN_AST BOOL Set_Shell(void);
 EXTERN_AST void Set_SOME_ENVIRONMENTS_VARIABLES_FOR_SCILAB(void);
-EXTERN_AST void SciEnvForWindows(void);
-EXTERN_AST void SetScilabEnvironmentVariables(char *DefaultSCIPATH);
-EXTERN_AST bool convertSlash(const char *path_in, char *path_out, bool slashToAntislash);
-EXTERN_AST bool AntislashToSlash(const char *pathwindows, char *pathunix);
-EXTERN_AST bool SlashToAntislash(const char *pathwindows, char *pathunix);
-EXTERN_AST bool isdir(const char * path);
-EXTERN_AST bool createdirectory(const char *path);
-EXTERN_AST bool isDrive(const char *strname);
+void SetScilabEnvironmentVariables(char *DefaultSCIPATH);
+BOOL convertSlash(const char *path_in, char *path_out, BOOL slashToAntislash);
+EXTERN_AST BOOL AntislashToSlash(const char *pathwindows, char *pathunix);
+BOOL SlashToAntislash(const char *pathwindows, char *pathunix);
 EXTERN_AST void SetScilabEnvironment(void);
-EXTERN_AST void SetScilabVariables(void);
-EXTERN_AST int SciEnvForOthers(void);
+#ifdef _MSC_VER
+void SciEnvForWindows(void);
+#else
+int SciEnvForOthers(void);
+#endif
 
index c9323c3..b888914 100644 (file)
@@ -33,6 +33,8 @@ extern "C"
 #include "setenvvar.h"
 #include "getshortpathname.h"
 #include "sciprint.h"
+#include "isdir.h"
+#include "createdirectory.h"
 #ifndef _MSC_VER
 #include <sys/stat.h>
 #endif
index 33e82a5..adaac7b 100644 (file)
@@ -52,6 +52,7 @@ extern "C"
 #include "getshortpathname.h"
 }
 
+static void SetScilabVariables(void);
 
 
 /*--------------------------------------------------------------------------*/
@@ -75,7 +76,7 @@ void SetScilabEnvironment(void)
     SetScilabVariables();
 }
 
-void SetScilabVariables(void)
+static void SetScilabVariables(void)
 {
     //create SCI
     defineSCI();
@@ -111,7 +112,7 @@ void SciEnvForWindows(void)
 
 #ifdef _MSC_VER
 /*--------------------------------------------------------------------------*/
-bool IsTheGoodShell(void)
+BOOL IsTheGoodShell(void)
 {
     bool bOK = false;
     char shellCmd[PATH_MAX];
@@ -134,7 +135,7 @@ bool IsTheGoodShell(void)
 }
 
 /*--------------------------------------------------------------------------*/
-bool Set_Shell(void)
+BOOL Set_Shell(void)
 {
     bool bOK = false;
     char env[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 10];
@@ -223,19 +224,19 @@ void SetScilabEnvironmentVariables(char *DefaultSCIPATH)
 #endif
 
 /*--------------------------------------------------------------------------*/
-bool AntislashToSlash(const char *pathwindows, char *pathunix)
+BOOL AntislashToSlash(const char *pathwindows, char *pathunix)
 {
-    return convertSlash(pathwindows, pathunix, false);
+    return convertSlash(pathwindows, pathunix, FALSE);
 }
 /*--------------------------------------------------------------------------*/
-bool SlashToAntislash(const char *pathunix, char *pathwindows)
+BOOL SlashToAntislash(const char *pathunix, char *pathwindows)
 {
-    return convertSlash(pathunix, pathwindows, true);
+    return convertSlash(pathunix, pathwindows, TRUE);
 }
 /*--------------------------------------------------------------------------*/
-bool convertSlash(const char *path_in, char *path_out, bool slashToAntislash)
+BOOL convertSlash(const char *path_in, char *path_out, BOOL slashToAntislash)
 {
-    bool bOK = false;
+    BOOL ret = FALSE;
     if ( (path_in) && (path_out) )
     {
         int i = 0;
@@ -247,7 +248,7 @@ bool convertSlash(const char *path_in, char *path_out, bool slashToAntislash)
                 if (path_in[i] == UNIX_SEPATATOR)
                 {
                     path_out[i] = WINDOWS_SEPATATOR;
-                    bOK = true;
+                    ret = TRUE;
                 }
             }
             else
@@ -255,108 +256,11 @@ bool convertSlash(const char *path_in, char *path_out, bool slashToAntislash)
                 if (path_in[i] == WINDOWS_SEPATATOR)
                 {
                     path_out[i] = UNIX_SEPATATOR;
-                    bOK = true;
+                    ret =  TRUE;
                 }
             }
         }
     }
-    else
-    {
-        bOK = false;
-    }
 
-    return bOK;
+    return ret;
 }
-
-/*--------------------------------------------------------------------------*/
-bool isdir(const char * path)
-{
-    bool bOK = false;
-#ifndef _MSC_VER
-    struct stat buf;
-    if (path == NULL)
-    {
-        return false;
-    }
-    if (stat(path, &buf) == 0 && S_ISDIR(buf.st_mode))
-    {
-        bOK = true;
-    }
-#else
-    if (isDrive(path))
-    {
-        return true;
-    }
-    else
-    {
-        char *pathTmp = NULL;
-        pathTmp = new char[strlen(path) + 1];
-        if (pathTmp)
-        {
-            DWORD attr = 0;
-            strcpy(pathTmp, path);
-            if ( (pathTmp[strlen(pathTmp) - 1] == '\\') || (pathTmp[strlen(pathTmp) - 1] == '/') )
-            {
-                pathTmp[strlen(pathTmp) - 1] = '\0';
-            }
-            attr = GetFileAttributesA(pathTmp);
-            delete[] pathTmp;
-            pathTmp = NULL;
-            if (attr == INVALID_FILE_ATTRIBUTES)
-            {
-                return false;
-            }
-            return ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) ? true : false;
-        }
-    }
-#endif
-    return bOK;
-}
-
-bool createdirectory(const char *path)
-{
-    bool bOK = false;
-#ifndef _MSC_VER
-    if  (!isdir(path))
-    {
-        if (mkdir(path, DIRMODE) == 0)
-        {
-            bOK = true;
-        }
-    }
-#else
-    if (CreateDirectoryA(path, NULL))
-    {
-        bOK = true;
-    }
-#endif
-    return bOK;
-}
-
-bool isDrive(const char *strname)
-{
-    // avoid warning -Werror=unused-parameter
-    (void)strname;
-#ifdef _MSC_VER
-    if (strname)
-    {
-        if ( ((strlen(strname) == 2) || (strlen(strname) == 3)) && (strname[1] == ':') )
-        {
-            if (strlen(strname) == 3)
-            {
-                if ( (strname[2] != '\\') && (strname[2] != '/') )
-                {
-                    return false;
-                }
-            }
-
-            if ( ( strname[0] >= 'A' && strname[0] <= 'Z' ) || ( strname[0] >= 'a' && strname[0] <= 'z' ) )
-            {
-                return true;
-            }
-        }
-    }
-#endif
-    return false;
-}
-
index 93856b4..46f8198 100644 (file)
@@ -39,7 +39,7 @@
 #include "scilabWrite.hxx"
 
 #ifdef _MSC_VER
-#include "SetScilabEnvironmentVariables.h"
+#include "setenvvar.h"
 #include "getScilabDirectory.h"
 #include <Windows.h>
 #endif
index cb2ed44..7b861e1 100644 (file)
     <ClInclude Include="includes\gw_fileio.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="includes\isdir.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="includes\mclose.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="src\cpp\mputi.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="includes\isdir.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="src\c\fileio.rc">
index fcecdb4..b398297 100644 (file)
@@ -30,9 +30,7 @@ extern "C"
 #include "setgetlanguage.h"
 #include "getScilabJavaVM.h"
 #include "sci_malloc.h"
-#ifdef _MSC_VER
-#include "ConvertSlash.h"
-#endif
+#include "setenvvar.h"
     /*--------------------------------------------------------------------------*/
 #define PATHTOCSS "/modules/helptools/css/javahelp.css"
 #define PATHTOBUILDDOC "/modules/helptools/build/doc/scilab_%s_help/"
index 653e4e8..42d9001 100644 (file)
@@ -24,7 +24,7 @@
 #include "setenvtcl.h"
 #include "GlobalTclInterp.h"
 #include "localization.h"
-#include "ConvertSlash.h"
+#include "setenvvar.h"
 #include "configvariable_interface.h"
 /*--------------------------------------------------------------------------*/
 extern void    TclSetLibraryPath(Tcl_Obj * pathPtr);
diff --git a/scilab/modules/windows_tools/includes/ConvertSlash.h b/scilab/modules/windows_tools/includes/ConvertSlash.h
deleted file mode 100644 (file)
index d10a46c..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA - Allan CORNET
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- */
-/*--------------------------------------------------------------------------*/
-#ifndef __CONVERTSLASH_H__
-#define __CONVERTSLASH_H__
-
-#include "BOOL.h"
-
-
-/* C:\Windows\system and C:/Windows/system */
-/* since Windows 2000 SP2 are supported */
-
-/**
-* convert a unix path to windows path 'format'
-* replaces '/' by '\'
-* @param [in] path in with '/'
-* @param [out] path out with '\'
-* @return TRUE or FALSE
-*/
-BOOL slashToAntislash(char *pathunix, char *pathwindows);
-
-/**
-* convert a windows path to unix path 'format'
-* replaces '\' by '/'
-* @param [in] path in with '\'
-* @param [out] path out with '/'
-* @return TRUE or FALSE
-*/
-BOOL AntislashToSlash(char *pathwindows, char *pathunix);
-
-#endif /* __CONVERTSLASH_H__ */
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/windows_tools/src/c/scilab_windows/ConvertSlash.c b/scilab/modules/windows_tools/src/c/scilab_windows/ConvertSlash.c
deleted file mode 100644 (file)
index 63523c5..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008 - INRIA - Allan CORNET
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- */
-/*--------------------------------------------------------------------------*/
-#include <string.h>
-#include "BOOL.h"
-#include "dynlib_scilab_windows.h"
-/*--------------------------------------------------------------------------*/
-#define UNIX_SEPATATOR '/'
-#define WINDOWS_SEPATATOR '\\'
-/*--------------------------------------------------------------------------*/
-static BOOL convertSlash(char *path_in, char *path_out, BOOL slashToAntislash);
-/*--------------------------------------------------------------------------*/
-SCILAB_WINDOWS_IMPEXP BOOL slashToAntislash(char *pathunix, char *pathwindows)
-{
-    return convertSlash(pathunix, pathwindows, TRUE);
-}
-/*--------------------------------------------------------------------------*/
-SCILAB_WINDOWS_IMPEXP BOOL AntislashToSlash(char *pathwindows, char *pathunix)
-{
-    return convertSlash(pathwindows, pathunix, FALSE);
-}
-/*--------------------------------------------------------------------------*/
-static BOOL convertSlash(char *path_in, char *path_out, BOOL slashToAntislash)
-{
-    BOOL bOK = FALSE;
-    if ( (path_in) && (path_out) )
-    {
-        int i = 0;
-        int len_path_out = 0;
-        strcpy(path_out, path_in);
-        len_path_out = (int)strlen(path_out);
-
-        for (i = 0; i < len_path_out; i++)
-        {
-            if ( slashToAntislash )
-            {
-                if (path_in[i] == UNIX_SEPATATOR)
-                {
-                    path_out[i] = WINDOWS_SEPATATOR;
-                    bOK = TRUE;
-                }
-            }
-            else
-            {
-                if (path_in[i] == WINDOWS_SEPATATOR)
-                {
-                    path_out[i] = UNIX_SEPATATOR;
-                    bOK = TRUE;
-                }
-            }
-        }
-    }
-    else
-    {
-        return FALSE;
-    }
-
-    return bOK;
-}
-/*--------------------------------------------------------------------------*/
index 7873769..732e997 100644 (file)
@@ -234,10 +234,8 @@ lib /DEF:"$(ProjectDir)Gui_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\cpp\scilab_windows\getScilabDirectory.cpp" />
-    <ClCompile Include="..\..\cpp\scilab_windows\SetScilabEnvironmentVariables.cpp" />
     <ClCompile Include="buildMainWindowTitle_Windows.c" />
     <ClCompile Include="console.c" />
-    <ClCompile Include="ConvertSlash.c" />
     <ClCompile Include="DllmainScilab_Windows.c" />
     <ClCompile Include="FilesAssociations.c" />
     <ClCompile Include="FindScilab.c" />
@@ -258,10 +256,8 @@ lib /DEF:"$(ProjectDir)Gui_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\cpp\scilab_windows\getScilabDirectory.h" />
-    <ClInclude Include="..\..\cpp\scilab_windows\SetScilabEnvironmentVariables.h" />
     <ClInclude Include="buildMainWindowTitle_Windows.h" />
     <ClInclude Include="console.h" />
-    <ClInclude Include="..\..\..\includes\ConvertSlash.h" />
     <ClInclude Include="dynlib_scilab_windows.h" />
     <ClInclude Include="FilesAssociations.h" />
     <ClInclude Include="FindScilab.h" />
index 4000566..23619b4 100644 (file)
@@ -26,9 +26,6 @@
     <ClCompile Include="console.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="ConvertSlash.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="DllmainScilab_Windows.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -86,9 +83,6 @@
     <ClCompile Include="..\..\cpp\scilab_windows\getScilabDirectory.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpp\scilab_windows\SetScilabEnvironmentVariables.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="buildMainWindowTitle_Windows.h">
@@ -97,9 +91,6 @@
     <ClInclude Include="console.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\includes\ConvertSlash.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="dynlib_scilab_windows.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\..\cpp\scilab_windows\getScilabDirectory.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\cpp\scilab_windows\SetScilabEnvironmentVariables.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="Gui_Import.def">
index 0b63c65..d88f87d 100644 (file)
@@ -313,7 +313,6 @@ lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="..\..\includes\ConvertSlash.h" />
     <ClInclude Include="..\..\includes\dynlib_windows_tools.h" />
     <ClInclude Include="..\..\includes\FocusOnConsole.h" />
     <ClInclude Include="..\..\includes\gw_windows_tools.h" />
index 926aa66..8c7dd50 100644 (file)
@@ -91,9 +91,6 @@
     <ClInclude Include="..\..\includes\FocusOnConsole.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\ConvertSlash.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\dynlib_windows_tools.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <Library Include="..\..\..\..\bin\blasplus.lib" />
     <Library Include="..\..\..\..\bin\lapack.lib" />
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/windows_tools/src/cpp/scilab_windows/SetScilabEnvironmentVariables.cpp b/scilab/modules/windows_tools/src/cpp/scilab_windows/SetScilabEnvironmentVariables.cpp
deleted file mode 100644 (file)
index 12e7a04..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) INRIA - Allan CORNET
-* Copyright (C) DIGITEO - 2010 - Allan CORNET
-*
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
-*
-*/
-
-/*--------------------------------------------------------------------------*/
-#include <windows.h>
-#include <stdio.h>
-extern "C"
-{
-#include "SetScilabEnvironmentVariables.h"
-#include "PATH_MAX.h"
-#include "sci_path.h"
-#include "sci_malloc.h"
-#include "getScilabDirectory.h"
-#include "scilabDefaults.h"
-#include "ConvertSlash.h"
-#include "charEncoding.h"
-#include "getshortpathname.h"
-#include "stristr.h"
-#include "strsubst.h"
-#include "os_string.h"
-}
-/*--------------------------------------------------------------------------*/
-static BOOL IsTheGoodShell(void);
-static BOOL Set_Shell(void);
-static BOOL Set_SCI_PATH(char *DefaultPath);
-static BOOL Set_HOME_PATH(char *DefaultPath);
-static BOOL AddScilabBinDirectoryToPATHEnvironnementVariable(char *DefaultPath);
-static BOOL Set_SOME_ENVIRONMENTS_VARIABLES_FOR_SCILAB(void);
-/*--------------------------------------------------------------------------*/
-/**
-* Set some environment variablesSCI, and some others
-*/
-void SciEnvForWindows(void)
-{
-    char *SCIPathName = getScilabDirectory(TRUE);
-
-    /* Correction Bug 1579 */
-    if (!IsTheGoodShell())
-    {
-        if ( (!Set_Shell()) || (!IsTheGoodShell()))
-        {
-            MessageBox(NULL,
-                       "Please modify ""ComSpec"" environment variable.\ncmd.exe on W2K and more.",
-                       "Warning", MB_ICONWARNING | MB_OK);
-        }
-    }
-
-    SetScilabEnvironmentVariables(SCIPathName);
-    if (SCIPathName)
-    {
-        FREE(SCIPathName);
-        SCIPathName = NULL;
-    }
-}
-/*--------------------------------------------------------------------------*/
-/* set env variables (used when calling scilab from * other programs) */
-void SetScilabEnvironmentVariables(char *DefaultSCIPATH)
-{
-    if (DefaultSCIPATH)
-    {
-        Set_SCI_PATH(DefaultSCIPATH);
-        Set_HOME_PATH(DefaultSCIPATH);
-        Set_SOME_ENVIRONMENTS_VARIABLES_FOR_SCILAB();
-        AddScilabBinDirectoryToPATHEnvironnementVariable(DefaultSCIPATH);
-    }
-    else
-    {
-        /* Error */
-        exit(1);
-    }
-
-}
-/*--------------------------------------------------------------------------*/
-BOOL Set_SCI_PATH(char *DefaultPath)
-{
-    BOOL bOK = FALSE;
-    char *ShortPath = NULL;
-
-    /* to be sure that it's unix 8.3 format */
-    /* c:/progra~1/scilab-5.0 */
-    ShortPath = getshortpathname(DefaultPath, &bOK);
-    if (ShortPath)
-    {
-        char env[PATH_MAX + 1 + 10];
-        AntislashToSlash(ShortPath, ShortPath);
-
-        sprintf (env, "SCI=%s", ShortPath);
-        setSCI(ShortPath);
-
-        if (ShortPath)
-        {
-            FREE(ShortPath);
-            ShortPath = NULL;
-        }
-
-        if (_putenv (env))
-        {
-            bOK = FALSE;
-        }
-        else
-        {
-            bOK = TRUE;
-        }
-    }
-    return bOK;
-}
-/*--------------------------------------------------------------------------*/
-BOOL Set_HOME_PATH(char *DefaultPath)
-{
-    wchar_t *wHOME = _wgetenv(L"HOME");
-    if (wHOME == NULL)
-    {
-        wchar_t *wUserProfile = _wgetenv(L"USERPROFILE");
-        if (wUserProfile)
-        {
-            return SetEnvironmentVariableW(L"HOME", wUserProfile);
-        }
-        else
-        {
-            /* if USERPROFILE is not defined , we use default profile */
-            wchar_t *wAllUsersProfile = _wgetenv(L"ALLUSERSPROFILE");
-            if (wAllUsersProfile)
-            {
-                return SetEnvironmentVariableW(L"HOME", wUserProfile);
-            }
-            else
-            {
-                BOOL bRes = FALSE;
-                wchar_t *wDefault = to_wide_string(DefaultPath);
-                if (wDefault)
-                {
-                    bRes = SetEnvironmentVariableW(L"HOME", wDefault);
-                    FREE(wDefault);
-                    wDefault = NULL;
-                }
-                return bRes;
-            }
-        }
-    }
-    return TRUE;
-}
-/*--------------------------------------------------------------------------*/
-BOOL Set_SOME_ENVIRONMENTS_VARIABLES_FOR_SCILAB(void)
-{
-    BOOL bOK = TRUE;
-
-#ifdef _MSC_VER
-    _putenv ("COMPILER=VC++");
-#endif
-
-    /* WIN32 variable Environment */
-#ifdef _WIN32
-    _putenv ("WIN32=OK");
-#endif
-
-    /* WIN64 variable Environment */
-#ifdef _WIN64
-    _putenv ("WIN64=OK");
-#endif
-
-    if ( GetSystemMetrics(SM_REMOTESESSION) )
-    {
-        _putenv ("SCILAB_MSTS_SESSION=OK");
-    }
-
-    return bOK;
-}
-/*--------------------------------------------------------------------------*/
-BOOL IsTheGoodShell(void)
-{
-    char shellCmd[PATH_MAX];
-    char drive[_MAX_DRIVE];
-    char dir[_MAX_DIR];
-    char fname[_MAX_FNAME];
-    char ext[_MAX_EXT];
-
-    strcpy(shellCmd, "");
-    strcpy(fname, "");
-    GetEnvironmentVariable("ComSpec", shellCmd, PATH_MAX);
-    os_splitpath(shellCmd, drive, dir, fname, ext);
-
-    if (_stricmp(fname, "cmd") == 0)
-    {
-        return TRUE;
-    }
-
-    return FALSE;
-}
-/*--------------------------------------------------------------------------*/
-BOOL Set_Shell(void)
-{
-    BOOL bOK = FALSE;
-    char env[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 10];
-    char *WINDIRPATH = NULL;
-
-    WINDIRPATH = getenv ("SystemRoot");
-    sprintf(env, "ComSpec=%s\\system32\\cmd.exe", WINDIRPATH);
-
-    if (_putenv (env))
-    {
-        bOK = FALSE;
-    }
-    else
-    {
-        bOK = TRUE;
-    }
-
-    if (WINDIRPATH)
-    {
-        FREE(WINDIRPATH);
-        WINDIRPATH = NULL;
-    }
-    return bOK;
-}
-/*--------------------------------------------------------------------------*/
-static BOOL AddScilabBinDirectoryToPATHEnvironnementVariable(char *DefaultPath)
-{
-#define SCILAB_BIN_PATH "%s/bin"
-#define NEW_PATH "PATH=%s;%s"
-
-    BOOL bOK = FALSE;
-    char *PATH = NULL;
-    char *env = NULL;
-    char scilabBinPath[MAX_PATH];
-    char *scilabBinPathConverted;
-
-    PATH = getenv("PATH");
-
-    env = (char*) MALLOC(sizeof(char) * (strlen(NEW_PATH) + strlen(PATH) +
-                                         strlen(DefaultPath) + 1));
-    if (env)
-    {
-        sprintf(scilabBinPath, SCILAB_BIN_PATH, DefaultPath);
-
-        scilabBinPathConverted = (char*) MALLOC(MAX_PATH * sizeof(char));
-#ifdef _MSC_VER
-        scilabBinPathConverted = strsub(scilabBinPath, "/", "\\");
-#else
-        scilabBinPathConverted = strdup(scilabBinPath);
-#endif
-        if (stristr(PATH, scilabBinPathConverted) == 0)
-        {
-            sprintf(env, NEW_PATH, scilabBinPathConverted, PATH);
-            if (_putenv (env))
-            {
-                bOK = FALSE;
-            }
-            else
-            {
-                bOK = TRUE;
-            }
-            FREE(env);
-            env = NULL;
-        }
-
-        FREE(scilabBinPathConverted);
-    }
-    return bOK;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/windows_tools/src/cpp/scilab_windows/SetScilabEnvironmentVariables.h b/scilab/modules/windows_tools/src/cpp/scilab_windows/SetScilabEnvironmentVariables.h
deleted file mode 100644 (file)
index 0778404..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) INRIA - Allan CORNET
-*
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
-*
-*/
-
-/*--------------------------------------------------------------------------*/
-#ifndef __SETSCILABENVIRONMENTVARIABLES_H__
-#define __SETSCILABENVIRONMENTVARIABLES_H__
-
-#include "dynlib_scilab_windows.h"
-
-/**
-* Set Some environment variables for Scilab (Windows)
-* @param[in] default path of scilab
-*/
-SCILAB_WINDOWS_IMPEXP void SetScilabEnvironmentVariables(char *DefaultSCIPATH);
-
-SCILAB_WINDOWS_IMPEXP void SciEnvForWindows(void);
-
-#endif /* __SETSCILABENVIRONMENTVARIABLES_H__ */
-/*--------------------------------------------------------------------------*/