Spreadsheet plugged. 15/5515/5
Cedric Delamarre [Thu, 24 Nov 2011 14:11:38 +0000 (15:11 +0100)]
Change-Id: Ib99b6ec260903d7018fa076587e82ebe1d420984

30 files changed:
scilab/etc/modules.xml.in
scilab/etc/modules.xml.vc
scilab/modules/ast/includes/run_AssignExp.hxx
scilab/modules/ast/includes/run_CallExp.hxx
scilab/modules/ast/includes/runvisitor.hxx
scilab/modules/core/sci_gateway/cpp/sci_pause.cpp
scilab/modules/development_tools/macros/test_run.sci
scilab/modules/elementary_functions/sci_gateway/cpp/sci_size.cpp
scilab/modules/fileio/src/cpp/mget.cpp
scilab/modules/fileio/tests/unit_tests/mkdir.dia.ref
scilab/modules/functions_manager/includes/dynamic_modules.hxx
scilab/modules/functions_manager/includes/module_declaration.hxx
scilab/modules/functions_manager/src/cpp/dynamic_modules.cpp
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/spreadsheet/Makefile.am
scilab/modules/spreadsheet/Makefile.in
scilab/modules/spreadsheet/includes/spreadsheet_gw.hxx [new file with mode: 0644]
scilab/modules/spreadsheet/macros/readxls.sci
scilab/modules/spreadsheet/sci_gateway/cpp/sci_xls_open.cpp [new file with mode: 0644]
scilab/modules/spreadsheet/sci_gateway/cpp/sci_xls_read.cpp [new file with mode: 0644]
scilab/modules/spreadsheet/sci_gateway/spreadsheet_gateway.xml
scilab/modules/spreadsheet/spreadsheet.vcxproj
scilab/modules/spreadsheet/spreadsheet.vcxproj.filters
scilab/modules/spreadsheet/src/c/ripole/ole.c
scilab/modules/spreadsheet/src/c/ripole/ole.h
scilab/modules/spreadsheet/src/c/xls.c
scilab/modules/spreadsheet/tests/unit_tests/readxls.dia.ref
scilab/modules/spreadsheet/tests/unit_tests/xls_open.dia.ref
scilab/modules/types/includes/mlist.hxx
scilab/modules/types/includes/tlist.hxx

index 467e6c2..7abb8ad 100644 (file)
@@ -45,5 +45,6 @@
     <module name="linear_algebra" activate="yes"/>
     <module name="statistics" activate="yes"/>
     <module name="differential_equations" activate="yes"/>
+    <module name="spreadsheet" activate="yes"/>
 </modules>
 
index d3373a9..2db24d7 100644 (file)
@@ -46,5 +46,6 @@
     <module name="linear_algebra" activate="yes"/>
     <module name="statistics" activate="yes"/>
     <module name="differential_equations" activate="yes"/>
+    <module name="spreadsheet" activate="yes"/>
 </modules>
 
index c609f94..cb4b122 100644 (file)
@@ -62,7 +62,7 @@ void visitprivate(const AssignExp  &e)
                 symbol::Context::getInstance()->put(pVar->name_get(), *pIT);
             }
 
-            if(e.is_verbose())
+            if(e.is_verbose() && ConfigVariable::isPromptShow())
             {
                 std::wostringstream ostr;
                 ostr << pVar->name_get().name_get() << L"  = " << std::endl << std::endl;
@@ -470,7 +470,7 @@ void visitprivate(const AssignExp  &e)
                     }
                 }
 
-                if(e.is_verbose())
+                if(e.is_verbose() && ConfigVariable::isPromptShow())
                 {
                     std::wostringstream ostr;
                     if(pVar)
@@ -533,7 +533,7 @@ void visitprivate(const AssignExp  &e)
             {
                 const SimpleVar *pListVar      = dynamic_cast<const SimpleVar*>((*it));
                 symbol::Context::getInstance()->put(pListVar->name_get(), *result_get(i));
-                if(e.is_verbose())
+                if(e.is_verbose() && ConfigVariable::isPromptShow())
                 {
                     std::wostringstream ostr;
                     ostr << pListVar->name_get().name_get() << L"  = " << std::endl;
@@ -643,7 +643,7 @@ void visitprivate(const AssignExp  &e)
                     symbol::Context::getInstance()->put(pVar->name_get(), *pOut);
                 }
 
-                if(e.is_verbose())
+                if(e.is_verbose() && ConfigVariable::isPromptShow())
                 {
                     std::wostringstream ostr;
                     if(pVar)
@@ -768,7 +768,7 @@ void visitprivate(const AssignExp  &e)
                 //TODO:
             }
 
-            if(e.is_verbose())
+            if(e.is_verbose() && ConfigVariable::isPromptShow())
             {
                 const wstring *pstName = getStructNameFromExp(pField);
 
index fafa222..5cc085d 100644 (file)
@@ -267,96 +267,164 @@ void visitprivate(const CallExp &e)
                 }
                 break;
             case InternalType::RealTList :
-            case InternalType::RealMList :
                 {
-                    list<wstring> stFields;
-                    typed_list iFields;
-                    InternalType::RealType rtIndex = InternalType::RealInternal;
-                    bool bTypeSet = false;
-
-                    if(pArgs->size() != 1)
-                    {
-                        std::wostringstream os;
-                        os << L"Wrong number of input argument(s): 1 expected.\n";
-                        throw ScilabError(os.str(), 999, (*e.args_get().begin())->location_get());
-                    }
-                    if((*pArgs)[0]->isString())
+                    bool bCallOverLoad = false;
+                    if(pArgs->size() == 1)
                     {
-                        rtIndex = InternalType::RealString;
-                        bTypeSet = true;
-                        String *pString = (*pArgs)[0]->getAs<types::String>();
-                        for(int i = 0 ; i < pString->getSize() ; i++)
+                        types::InternalType* pArg = (*pArgs)[0];
+                        if( pArg->isDouble() ||
+                            pArg->isInt() || 
+                            pArg->isBool() ||  
+                            pArg->isImplicitList() || 
+                            pArg->isColon() || 
+                            pArg->isDollar())
+
+                        {//call "normal" extract
+                            typed_list iField;
+                            iField.push_back(pArg);
+                            ResultList = pIT->getAs<TList>()->extract(&iField);
+                        }
+                        else if(pArg->isString())
+                        {//extractStrings
+                            list<wstring> stFields;
+                            String *pString = (*pArgs)[0]->getAs<types::String>();
+                            for(int i = 0 ; i < pString->getSize() ; i++)
+                            {
+                                stFields.push_back(pString->get(i));
+                            }
+                            
+                            ResultList = pIT->getAs<TList>()->extractStrings(stFields);
+                            if(ResultList.empty())
+                            {
+                                bCallOverLoad = true;
+                            }
+                        }
+                        else
                         {
-                            stFields.push_back(pString->get(i));
+                            bCallOverLoad = true;
                         }
                     }
-                    else if((*pArgs)[0]->isDouble())
+                    else
                     {
-                        rtIndex = InternalType::RealDouble;
-                        bTypeSet = true;
-                        Double* pDbl = (*pArgs)[0]->getAs<types::Double>();
-                        iFields.push_back(pDbl);
+                        bCallOverLoad = true;
                     }
 
-                    result_set(NULL);
-
-                    if(rtIndex  == InternalType::RealDouble)
+                    if(bCallOverLoad)
                     {
-                        if(pIT->isTList())
+                        types::typed_list in;
+
+                        //create input argument list
+
+                        //protect inputs 
+                        for(int i = 0 ; i < pArgs->size() ; i++)
                         {
-                            ResultList = pIT->getAs<TList>()->extract(&iFields);
+                            (*pArgs)[i]->IncreaseRef();
+                            in.push_back((*pArgs)[i]);
                         }
-                        else
-                        {//try to call extraction function %MList_type_e
-                            types::typed_list in;
 
-                            (*pArgs)[0]->IncreaseRef();
-                            pIT->IncreaseRef();
-                            in.push_back((*pArgs)[0]);
-                            in.push_back(pIT);
+                        //protect TList
+                        pIT->IncreaseRef();
+                        in.push_back(pIT);
 
-                            //try to call specific exrtaction function
-                            try
-                            {
-                                Overload::call(L"%" + pIT->getAs<MList>()->getTypeStr() + L"_e", in, 1, ResultList, this);
-                            }
-                            catch(ScilabError /*&e*/)
-                            {//if call failed try to call generic extraction function
-                                Overload::call(L"%l_e", in, 1, ResultList, this);
-                            }
+                        try
+                        {//try to call specific exrtaction function
+                            Overload::call(L"%" + pIT->getAs<TList>()->getTypeStr() + L"_e", in, 1, ResultList, this);
+                        }
+                        catch(ScilabError /*&e*/)
+                        {//if call failed try to call generic extraction function
+                            Overload::call(L"%l_e", in, 1, ResultList, this);
+                        }
+
+                        for(int i = 0 ; i < pArgs->size() ; i++)
+                        {
+                            (*pArgs)[i]->DecreaseRef();
+                        }
+                        pIT->DecreaseRef();
+                    }
 
-                            (*pArgs)[0]->DecreaseRef();
-                            pIT->DecreaseRef();
+                    switch(ResultList.size())
+                    {
+                    case 0 :
+                        {
+                            std::wostringstream os;
+                            os << L"Invalid index.\n";
+                            throw ScilabError(os.str(), 999, (*e.args_get().begin())->location_get());
+                        }
+                        break;
+                    case 1 :
+                        result_set(ResultList[0]);
+                        break;
+                    default :
+                        for(int i = 0 ; i < static_cast<int>(ResultList.size()) ; i++)
+                        {
+                            result_set(i, ResultList[i]);
                         }
+                        break;
                     }
-                    else if(rtIndex  == InternalType::RealString)
-                    {//TList::extractStrings can be call on TList or MList
-                        ResultList = pIT->getAs<TList>()->extractStrings(stFields);
-                        if(ResultList.empty())
-                        {//call overload %l_e
-                            types::typed_list in;
-
-                            (*pArgs)[0]->IncreaseRef();
-                            pIT->IncreaseRef();
-                            in.push_back((*pArgs)[0]);
-                            in.push_back(pIT);
-                            //try to call specific exrtaction function
-                            try
+                    break;
+                }
+            case InternalType::RealMList :
+                {
+                    bool bCallOverLoad = false;
+                    if(pArgs->size() == 1)
+                    {
+                        types::InternalType* pArg = (*pArgs)[0];
+                        if(pArg->isString())
+                        {//extractStrings
+                            list<wstring> stFields;
+                            String *pString = (*pArgs)[0]->getAs<types::String>();
+                            for(int i = 0 ; i < pString->getSize() ; i++)
                             {
-                                Overload::call(L"%" + pIT->getAs<TList>()->getTypeStr() + L"_e", in, 1, ResultList, this);
+                                stFields.push_back(pString->get(i));
                             }
-                            catch(ScilabError /*&e*/)
-                            {//if call failed try to call generic extraction function
-                               Overload::call(L"%l_e", in, 1, ResultList, this);
+                            
+                            ResultList = pIT->getAs<MList>()->extractStrings(stFields);
+                            if(ResultList.empty())
+                            {
+                                bCallOverLoad = true;
                             }
-
-                            (*pArgs)[0]->DecreaseRef();
-                            pIT->DecreaseRef();
+                        }
+                        else
+                        {
+                            bCallOverLoad = true;
                         }
                     }
                     else
                     {
-                        ResultList = pIT->getAs<TList>()->extract(pArgs);
+                        bCallOverLoad = true;
+                    }
+
+                    if(bCallOverLoad)
+                    {
+                        types::typed_list in;
+
+                        //create input argument list
+
+                        //protect inputs 
+                        for(int i = 0 ; i < pArgs->size() ; i++)
+                        {
+                            (*pArgs)[i]->IncreaseRef();
+                            in.push_back((*pArgs)[i]);
+                        }
+
+                        //protect TList
+                        pIT->IncreaseRef();
+                        in.push_back(pIT);
+
+                        try
+                        {//try to call specific exrtaction function
+                            Overload::call(L"%" + pIT->getAs<MList>()->getTypeStr() + L"_e", in, 1, ResultList, this);
+                        }
+                        catch(ScilabError /*&e*/)
+                        {//if call failed try to call generic extraction function
+                            Overload::call(L"%l_e", in, 1, ResultList, this);
+                        }
+
+                        for(int i = 0 ; i < pArgs->size() ; i++)
+                        {
+                            (*pArgs)[i]->DecreaseRef();
+                        }
+                        pIT->DecreaseRef();
                     }
 
                     switch(ResultList.size())
@@ -378,8 +446,8 @@ void visitprivate(const CallExp &e)
                         }
                         break;
                     }
+                    break;
                 }
-                break;
             case InternalType::RealCell :
                 pOut = pIT->getAs<Cell>()->extract(pArgs);
                 break;
index c643a83..1026e95 100644 (file)
@@ -227,7 +227,17 @@ namespace ast
             for(it = _plstArg.begin() ; it != _plstArg.end() ; it++)
             {
                 (*it)->accept(*this);
-                pArgs->push_back(result_get());
+                if(result_getSize() > 1)
+                {
+                    for(int i = 0 ; i < result_getSize() ; i++)
+                    {
+                        pArgs->push_back(result_get(i));
+                    }
+                }
+                else
+                {
+                    pArgs->push_back(result_get());
+                }
             }
             //to be sure, delete operation does not delete result
             result_set(NULL);
@@ -365,7 +375,7 @@ namespace ast
             result_set(pI);
             if(pI != NULL)
             {
-                if(e.is_verbose() && pI->isCallable() == false)
+                if(e.is_verbose() && pI->isCallable() == false && ConfigVariable::isPromptShow())
                 {
                     std::wostringstream ostr;
                     ostr << e.name_get().name_get() << L"  = " << L"(" << pI->getRef() << L")"<< std::endl;
@@ -1106,7 +1116,7 @@ namespace ast
                             //symbol::Context::getInstance()->put(symbol::Symbol(L"ans"), *execMe.result_get());
                             InternalType* pITAns = result_get()->clone();
                             symbol::Context::getInstance()->put(*m_pAns, *pITAns);
-                            if((*itExp)->is_verbose())
+                            if((*itExp)->is_verbose() && ConfigVariable::isPromptShow())
                             {
                                 //TODO manage multiple returns
                                 scilabWriteW(L"ans = \n\n");
index bc16acc..b2e4e57 100644 (file)
@@ -33,12 +33,6 @@ types::Function::ReturnValue sci_pause(types::typed_list &in, int _iRetCount, ty
         return types::Function::Error;
     }
 
-    if(_iRetCount != -1)
-    {
-        ScierrorW(78,_W("%ls: Wrong number of output argument(s): %d expected.\n"), L"pause", 0);
-        return types::Function::Error;
-    }
-
     ConfigVariable::IncreasePauseLevel();
     Runner::UnlockPrompt();
     ThreadId* pThread = ConfigVariable::getLastRunningThread();
index 5d80ca1..45d4340 100644 (file)
 //   Launch unit tests.
 
 function test_run(varargin)
-    function status = test_module(_params)
-        name = splitModule(_params.moduleName);
-        if with_module(name(1)) then
-            // It's a scilab internal module
-            module.path = pathconvert(SCI + "/modules/" + name(1), %F);
-        elseif or(librarieslist() == "atomslib") & atomsIsLoaded(name(1)) then
-            // It's an ATOMS module
-            module.path = pathconvert(atomsGetLoadedPath(name(1)) , %F, %T);
-        elseif isdir(name(1)) then
-            // It's an external module
-            module.path = pathconvert(name(1), %F);
-        else
-            // It's an error
-            error(sprintf(gettext("%s is not an installed module or toolbox"), name(1)));
-        end
-
-        //get tests from path
-        my_types = ["unit_tests","nonreg_tests"];
-
-        directories = [];
-        for i=1:size(my_types,"*")
-            if (_params.testTypes == "all_tests") | (_params.testTypes == my_types(i)) then
-                directory_path = module.path + "/tests/" + my_types(i);
-                for j=2:size(name,"*")
-                    directory_path = directory_path + filesep() + name(j);
-                end
-
-                if isdir(directory_path) then
-                    directories = [directories;getDirectories(directory_path + filesep())];
-                end
-            end
-        end
-
-        tests = [];
-        if( _params.tests_mat == [])
-            for i=1:size(directories, "*")
-                currentDir = directories(i);
-                tests_mat = gsort(basename(listfiles(currentDir + filesep() + "*.tst")),"lr","i");
-
-                for j = 1:size(tests_mat, "*")
-                    if or(tests_mat(j) == _params.skip_mat) == %f then
-                        tests($+1, [1,2]) = [currentDir, tests_mat(j)];
-                    end
-                end
-            end
-        else
-            //not empty tests_mat
-            for i = 1:size(_params.tests_mat, "*")
-                bFind = %f;
-                for j = 1:size(directories, "*")
-                    currentDir = directories(j);
-                    testFile = currentDir + filesep() + _params.tests_mat(i) + ".tst";
-                    if isfile(testFile) then
-                        tests($+1, [1,2]) = [currentDir, _params.tests_mat(i)];
-                        bFind = %t;
-                    end
-                end
-
-                if bFind == %f then
-                    error(sprintf(gettext("The test ""%s"" is not available from the ""%s"" module"), _params.tests_mat(i), name(1)));
-                end
-            end
-        end
-
-        //initialize counter
-        details_failed      = "";
-        test_count          = size(tests, "r");
-        test_passed_count   = 0;
-        test_failed_count   = 0;
-        test_skipped_count  = 0;
-
-        moduleName          = _params.moduleName;
-        // Improve the display of the module
-        if isdir(moduleName) then
-            if part(moduleName,1:length(SCI)) == SCI then
-                moduleName = "SCI" + part(moduleName,length(SCI)+1:length(moduleName));
-            elseif part(moduleName,1:length(SCIHOME)) == SCIHOME then
-                moduleName = "SCIHOME" + part(moduleName,length(SCIHOME)+1:length(moduleName));
-            end
-        end
-
-        //don't test only return list of tests.
-        if _params.reference == "list" then
-            for i = 1:test_count
-                if size(name, "*") > 1 then
-                    displayModuleName = sprintf("%s", name(1));
-                    for j=2:size(name, "*")
-                        displayModuleName = displayModuleName + sprintf("|%s", name(j));
-                    end
-                else
-                    displayModuleName = sprintf("%s", name(1));
-                end
-                tests(i,1) = displayModuleName;
-            end
-            status.list         = tests;
-            status.test_count   = test_count;
-            return;
-        end
-
-        tic();
-        for i = 1:test_count
-            printf("   %03d/%03d - ",i, test_count);
-
-            if size(name, "*") > 1 then
-                displayModuleName = sprintf("[%s", name(1));
-                for j=2:size(name, "*")
-                    displayModuleName = displayModuleName + sprintf("|%s", name(j));
-                end
-                displayModuleName = displayModuleName + sprintf("] %s", tests(i,2));
-            else
-                displayModuleName = sprintf("[%s] %s", name(1), tests(i,2));
-            end
-
-            printf("%s", displayModuleName);
-            for j = length(displayModuleName):50
-                printf(".");
-            end
-
-            result = test_single(_params, tests(i,1), tests(i,2));
-
-            if result.id == 0 then
-                printf("passed\n");
-                test_passed_count = test_passed_count + 1;
-            else
-                msg = sprintf(result.message);
-                printf("%s \n", msg(1));
-                for kline = 2:size(msg, "*")
-                    printf(part(" ", 1:62) + "%s \n", msg(2));
-                end
-
-                if result.id < 10 then
-                    //failed
-                    test_failed_count = test_failed_count + 1;
-                    details_failed = [ details_failed ; sprintf("   TEST : [%s] %s", _params.moduleName, tests(i,2))];
-                    details_failed = [ details_failed ; sprintf("   %s", result.message) ];
-                    details_failed = [ details_failed ; result.details ];
-                    details_failed = [ details_failed ; "" ];
-                elseif (result.id >= 10) & (result.id < 20) then
-                    // skipped
-                    test_skipped_count = test_skipped_count + 1;
-                end
-            end
-        end
-
-        status.totalTime = toc();
-        clearglobal TICTOC;
-        status.test_passed_count  = test_passed_count;
-        status.test_failed_count  = test_failed_count;
-        status.test_skipped_count = test_skipped_count;
-
-        // Summary
-        status.test_count     = test_count;
-        status.details_failed   = details_failed;
-    endfunction
-
-    function status = test_single(_module, _testPath, _testName)
-        //option flag
-
-        skip          = %F;
-        interactive   = %F;
-        notyetfixed   = %F;
-        longtime      = %F;
-        reopened      = %F;
-        jvm           = %T;
-        graphic       = %F;
-        execMode      = "";
-        platform      = "all";
-        language      = "any";
-        try_catch     = %T;
-        error_output  = "check";
-        reference     = "check";
-        xcosNeeded    = %F;
-
-        //some paths
-        tmp_tst     = pathconvert( TMPDIR + "/" + _testName + ".tst", %F);
-        tmp_dia     = pathconvert( TMPDIR + "/" + _testName + ".dia.tmp", %F);
-        tmp_res     = pathconvert( TMPDIR + "/" + _testName + ".res", %F);
-        tmp_err     = pathconvert( TMPDIR + "/" + _testName + ".err", %F);
-        path_dia    = pathconvert( TMPDIR + "/" + _testName + ".dia", %F);
-
-        path_dia_ref  = _testPath + _testName + ".dia.ref";
-        // Reference file management OS by OS
-        if getos() == 'Windows' then
-            altreffile  = [ _testPath + _testName + ".win.dia.ref" ];
-        elseif getos() == 'Darwin' then
-            altreffile  = [ _testPath + _testName + ".unix.dia.ref" ; _testPath + _testName + ".macosx.dia.ref" ];
-        elseif getos() == 'Linux' then
-            altreffile  = [ _testPath + _testName + ".unix.dia.ref" ; _testPath + _testName + ".linux.dia.ref" ];
-        else
-            altreffile  = [ _testPath + _testName + ".unix.dia.ref" ];
-        end
-
-        for i=1:size(altreffile,"*")
-            if isfile(altreffile(i)) then
-                path_dia_ref = altreffile(i);
-            end
-        end
-
-        //output structure
-        status.id = 0;
-        status.message = "";
-        status.details = "";
-
-        //Reset standard globals
-        rand("seed",0);
-        rand("uniform");
-
-        //load file
-        testFile = _testPath + _testName + ".tst";
-        sciFile = mgetl(testFile);
-
-        //read options
-        if ~isempty(grep(sciFile, "<-- NOT FIXED -->")) then
-            status.id = 10;
-            status.message = "skipped: not yet fixed";
-            return;
-        end
-
-        if ~isempty(grep(sciFile, "<-- REOPENED -->")) then
-            status.id = 10;
-            status.message = "skipped: Bug reopened";
-            return;
-        end
-
-        // platform
-        if ~isempty(grep(sciFile, "<-- WINDOWS ONLY -->")) & getos() <> "Windows" then
-            status.id = 10;
-            status.message = "skipped: Windows only";
-            return;
-        end
-
-        if ~isempty(grep(sciFile, "<-- LINUX ONLY -->")) & getos() <> "Linux" then
-            status.id = 10;
-            status.message = "skipped: Linux only";
-            return;
-        end
-
-        if ~isempty(grep(sciFile, "<-- MACOSX ONLY -->")) & getos() <> "Darwin" then
-            status.id = 10;
-            status.message = "skipped: MacOSX only";
-            return;
-        end
-
-        // Test execution
-        if ~isempty(grep(sciFile, "<-- INTERACTIVE TEST -->")) then
-            status.id = 10;
-            status.message = "skipped: interactive test";
-            return;
-        end
-
-        if ~isempty(grep(sciFile, "<-- LONG TIME EXECUTION -->")) & ~_module.longtime then
-            status.id = 10;
-            status.message = "skipped: Long time duration";
-            return;
-        end
-
-        if ~isempty(grep(sciFile, "<-- TEST WITH GRAPHIC -->")) then
-            if _module.wanted_mode == "NWNI" then
-                status.id = 10;
-                status.message = "skipped: Test with graphic";
-                return;
-            end
-
-            graphic = %T;
-            jvm = %T;
-            execMode = "NW";
-        end
-
-        if ~isempty(grep(sciFile, "<-- JVM NOT MANDATORY -->")) then
-            jvm = %F;
-            execMode = "NWNI";
-        end
-
-        if ~isempty(grep(sciFile, "<-- XCOS TEST -->")) then
-            xcosNeeded = %T;
-            jvm = %T;
-        end
-
-        // Language
-        if ~isempty(grep(sciFile, "<-- FRENCH IMPOSED -->")) then
-            language = "fr_FR";
-        end
-
-
-        if ~isempty(grep(sciFile, "<-- ENGLISH IMPOSED -->")) then
-            language = "en_US";
-        end
-
-        // Test building
-        if ~isempty(grep(sciFile, "<-- NO TRY CATCH -->")) then
-            try_catch = %F;
-        end
-
-        // Test result
-        if ~isempty(grep(sciFile, "<-- NO CHECK ERROR OUTPUT -->")) then
-            error_output = "skip";
-        end
-
-        if ~isempty(grep(sciFile, "<-- NO CHECK REF -->")) then
-            reference = "skip";
-        end
-
-        //build real test file
-
-        // Do some modification in tst file
-        //replace "pause,end" by "bugmes();quit;end"
-        sciFile = strsubst(sciFile, "pause,end", "bugmes();quit;end");
-        sciFile = strsubst(sciFile, "pause, end", "bugmes();quit;end");
-        sciFile = strsubst(sciFile, "pause;end", "bugmes();quit;end");
-        sciFile = strsubst(sciFile, "pause; end", "bugmes();quit;end");
-
-        //to avoid suppression of input --> with prompts
-        sciFile = strsubst(sciFile, "-->", "@#>");
-        //remove halt calls
-        sciFile = strsubst(sciFile, "halt();", "");
-
-        // Build test header
-        head = [
-            "// <-- HEADER START -->";
-            "mode(3);" ;
-            "lines(28,72);";
-            "lines(0);" ;
-            "function %onprompt" ;
-            "   quit;" ;
-            "endfunction" ;
-            "deff(''[]=bugmes()'',''write(%io(2),''''error on test'''')'');";
-            "predef(''all'');" ;
-            "tmpdirToPrint = msprintf(''TMPDIR1=''''%s''''\n'',TMPDIR);"
-        ]
-
-        if xcosNeeded then
-            head = [ head ; "loadXcosLibs();"];
-        end
-
-        if try_catch then
-            head = [ head ; "try" ];
-        end
-
-        head = [
-            head;
-            "diary(''" + tmp_dia + "'');";
-            "write(%io(2),tmpdirToPrint);";
-            "// <-- HEADER END -->"
-        ];
-
-        // Build test footer
-        tail = [ "// <-- FOOTER START -->" ];
-
-        if try_catch then
-            tail = [ 
-                tail;
-                "catch";
-                "   errmsg = ""<--""+""Error on the test script file""+""-->"";";
-                "   printf(""%s\n"",errmsg);";
-                "   lasterror()";
-                "end";
-            ];
-        end
-
-        tail = [ tail; "diary(0);" ];
-
-        if graphic then
-            tail = [ tail; "xdel(winsid());sleep(1000);" ];
-        end
-
-        tail = [ tail; "exit(0);" ; "// <-- FOOTER END -->" ];
-
-        //Build final test
-        sciFile = [head ; sciFile ; tail];
-
-
-        //Build command to execute
-
-        //scilab path
-        if (getos() <> 'Windows') & ~isfile(SCI+"/bin/scilab") then
-            SCI_BIN = strsubst(SCI,'share/scilab','');
-        else
-            SCI_BIN = SCI;
-        end
-
-        //mode
-        if _module.wanted_mode == "NW" then
-            mode_arg = "-nw";
-            elseif _module.wanted_mode == "NWNI" then
-            mode_arg = "-nwni";
-        else
-            if execMode == "NWNI" then
-                mode_arg = "-nwni";
-                elseif execMode == "NW" then
-                mode_arg = "-nw";
-            else
-                mode_arg = "-nw";
-            end
-        end
-
-        //language
-        if language == "any" then
-            language_arg = "";
-        elseif getos() == 'Windows' then
-            language_arg = "-l "+ language;
-        else
-            language_arg = "LANG=" + language + " ";
-        end
-        loader_path = pathconvert(fullfile(_module.moduleName, 'loader.sce'), %f);
-
-        // Build final command
-        if getos() == 'Windows' then
-            if (isdir(_module.moduleName) & isfile(loader_path)) // external module not in Scilab
-                test_cmd = "( """ + SCI_BIN + "\bin\scilex.exe" + """" + " " + mode_arg + " " + language_arg + " -nb -e ""exec(""""" + loader_path + """"");exec(""""" + tmp_tst + """"");"" > """ + tmp_res + """ ) 2> """ + tmp_err + """";
-            else // standard module
-                test_cmd = "( """ + SCI_BIN + "\bin\scilex.exe" + """" + " " + mode_arg + " " + language_arg + " -nb -f """ + tmp_tst + """ > """ + tmp_res + """ ) 2> """ + tmp_err + """";
-            end
-        else
-            if (isdir(_module.moduleName) & isfile(loader_path))
-                test_cmd = "( " + language_arg + " " + SCI_BIN + "/bin/scilab " + mode_arg + " -nb -e ""exec(''" + loader_path + "'');exec(''" + tmp_tst +"'');""" + " > " + tmp_res + " ) 2> " + tmp_err;
-            else
-                test_cmd = "( " + language_arg + " " + SCI_BIN + "/bin/scilab " + mode_arg + " -nb -f " + tmp_tst + " > " + tmp_res + " ) 2> " + tmp_err;
-            end
-        end
-
-        //clean previous tmp files
-        if isfile(tmp_tst) then
-            deletefile(tmp_tst);
-        end
-
-        if isfile(tmp_dia) then
-            deletefile(tmp_dia);
-        end
-
-        if isfile(tmp_res) then
-            deletefile(tmp_res);
-        end
-
-        if isfile(tmp_err) then
-            deletefile(tmp_err);
-        end
-
-        //create tmp test file
-        mputl(sciFile, tmp_tst);
-
-        //execute test
-        host(test_cmd);
-
-        //Check errors
-        if (error_output == "check") & (_module.error_output == "check") then
-            if getos() == "Darwin" then
-                tmp_errfile_info = fileinfo(tmp_err);
-                msg = "JavaVM: requested Java version (1.5) not available. Using Java at ""/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"" instead."
-
-                if ~isempty(tmp_errfile_info) then
-                    txt = mgetl(tmp_err);
-                    txt(txt==msg) = [];
-                    if isempty(txt) then
-                        deletefile(tmp_err);
-                    end
-                end
-            end
-
-            tmp_errfile_info = fileinfo(tmp_err);
-
-            if isfile(tmp_err) & tmp_errfile_info(1) <> 0 then
-                status.id = 5;
-                status.message = "failed: error_output not empty\n   Use ''no_check_error_output'' option to disable this check.";
-                status.details = checkthefile(tmp_err);
-                return;
-            end
-        end
-
-        //Process output files
-
-        //Get the dia file
-        if isfile(tmp_dia) then
-            dia = mgetl(tmp_dia);
-        else
-            status.id = 6;
-            status.message = "failed: the dia file is not correct";
-            status.details = checkthefile(tmp_dia);
-            return;
-        end
-
-        // To get TMPDIR value
-        tmpdir1_line = grep(dia, "TMPDIR1");
-        execstr(dia(tmpdir1_line));
-
-        //Check for execution errors
-        if try_catch & grep(dia,"<--Error on the test script file-->") <> [] then
-            details = [ checkthefile(tmp_dia); ..
-            launchthecommand(testFile)];
-            status.id = 3;
-            status.message = "failed: premature end of the test script";
-            status.details = details;
-            return;
-        end
-
-        // Remove Header and Footer
-        dia = remove_headers(dia);
-
-        //Check for execution errors
-        dia_tmp = dia;
-
-        // remove commented lines
-        dia_tmp(grep(dia_tmp, "//")) = [];
-
-        if try_catch & grep(dia_tmp, "!--error") <> [] then
-            details = [ checkthefile(tmp_dia); ..
-            launchthecommand(testFile) ];
-            status.id = 1;
-            status.message = "failed: the string (!--error) has been detected";
-            status.details = details;
-            return;
-        end
-
-
-        if grep(dia_tmp,"error on test")<>[] then
-            details = [ checkthefile(tmp_dia); ..
-            launchthecommand(testFile) ];
-            status.id = 2;
-            status.message = "failed: one or several tests failed";
-            status.details = details;
-            return;
-        end
-
-
-        if tmpdir1_line == [] then
-            status.id = 6;
-            status.message = "failed: the dia file is not correct";
-            status.details = checkthefile(tmp_dia);
-            return;
-        end
-
-
-        // Check the reference file only if check_ref (i.e. for the whole
-        // test sequence) is true and this_check_ref (i.e. for the specific current .tst)
-        // is true.
-
-        if (reference=="check") & (_module.reference=="check")  then
-            if isfile(path_dia_ref) == %f then
-                status.id = 5;
-                status.message = "failed: the ref file doesn''t exist\n   Use ''no_check_ref'' option to disable this check.";
-                status.details = createthefile(path_dia_ref);
-                return;
-            end
-        end
-
-        // Comparaison ref <--> dia
-
-        if ( (reference=="check") & (_module.reference=="check") ) | (_module.reference=="create") then
-            //  Do some modification in  dia file
-
-            dia(grep(dia, "write(%io(2), tmpdirToPrint")) = [];
-            dia(grep(dia, "TMPDIR1")) = [];
-            dia(grep(dia, "diary(0)")) = [];
-
-            dia = strsubst(dia,TMPDIR ,"TMPDIR");
-            dia = strsubst(dia,TMPDIR1, "TMPDIR");
-
-            if getos() == 'Windows' then
-                dia = strsubst(dia, strsubst(TMPDIR, "\","/"), "TMPDIR");
-                dia = strsubst(dia, strsubst(TMPDIR1, "\","/"), "TMPDIR");
-                dia = strsubst(dia, strsubst(TMPDIR, "/","\"), "TMPDIR");
-                dia = strsubst(dia, strsubst(TMPDIR1, "/","\"), "TMPDIR");
-                dia = strsubst(dia, strsubst(getshortpathname(TMPDIR), "\","/"), "TMPDIR");
-                dia = strsubst(dia, strsubst(getshortpathname(TMPDIR1), "\","/"), "TMPDIR");
-                dia = strsubst(dia, getshortpathname(TMPDIR), "TMPDIR");
-                dia = strsubst(dia, getshortpathname(TMPDIR1), "TMPDIR");
-            end
-
-            dia = strsubst(dia, SCI, "SCI");
-
-            if getos() == 'Windows' then
-                dia = strsubst(dia, strsubst(SCI, "\","/"), "SCI");
-                dia = strsubst(dia, strsubst(SCI, "/","\"), "SCI");
-                dia = strsubst(dia, strsubst(getshortpathname(SCI), "\","/"), "SCI");
-                dia = strsubst(dia, getshortpathname(SCI), "SCI");
-            end
-
-            //suppress the prompts
-            dia = strsubst(dia, "-->", "");
-            dia = strsubst(dia, "@#>", "-->");
-            dia = strsubst(dia, "-1->", "");
-
-            //standardise  number display
-
-            // strsubst(dia, " .", "0.");
-            // strsubst(dia, "-.", "-0.")
-            // strsubst(dia, "E+", "D+");
-            // strsubst(dia, "E-", "D-");
-
-            //not to change the ref files
-            dia = strsubst(dia ,"bugmes();return", "bugmes();quit");
-
-            if _module.reference=="create" then
-                // Delete previous .dia.ref file
-                if isfile(path_dia_ref) then
-                    deletefile(path_dia_ref)
-                end
-
-                mputl(dia, path_dia_ref);
-                status.id = 20;
-                status.message = "passed: ref created";
-                return;
-            else
-            // write down the resulting dia file
-                mputl(dia, path_dia);
-
-                //Check for diff with the .ref file
-                [u,ierr] = mopen(path_dia_ref, "r");
-                if ierr== 0 then //ref file exists
-                    ref=mgetl(u);
-                    mclose(u)
-
-                    // suppress blank (diff -nw)
-                    dia = strsubst(dia, ' ', '')
-                    ref = strsubst(ref, ' ', '')
-
-                    dia(find(dia == '')) = [];
-                    ref(find(ref == '')) = [];
-
-                    dia(find(dia == '')) = [];
-                    ref(find(ref == '')) = [];
-
-                    dia(find(part(dia, (1:2)) == "//")) = [];
-                    ref(find(part(ref, (1:2)) == "//")) = [];
-
-                    if or(ref <> dia) then
-                        status.id = 4;
-                        status.message = "failed: dia and ref are not equal";
-                        status.details = comparethefiles(path_dia, path_dia_ref);
-                        return;
-                    end
-
-                else
-                    error(sprintf(gettext("The ref file (%s) doesn''t exist"), path_dia_ref));
-                end
-            end
-        end
-    endfunction
-
-    // checkthefile
-    function msg = checkthefile( filename )
-        // Returns a 2-by-1 matrix of strings, containing a message such as:
-        //   Check the following file :
-        //   - C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.tst
-        // Workaround for bug #4827
-        msg(1) = "   Check the following file :"
-        msg(2) = "   - "+filename
-    endfunction
-
-    // launchthecommand
-    function msg = launchthecommand( filename )
-        // Returns a 2-by-1 matrix of strings, containing a message such as:
-        //   Or launch the following command :
-        //   - exec("C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.tst")
-        // Workaround for bug #4827
-        msg(1) = "   Or launch the following command :"
-        msg(2) = "   - exec(""" + filename + """);"
-    endfunction
-
-    // => remove header from the diary txt
-    function dia_out = remove_headers(dia_in)
-        dia_out = dia_in;
-        body_start = grep(dia_out,"// <-- HEADER END -->");
-        if body_start <> [] then
-            dia_out(1:body_start(1)) = [];
-        end
-
-        body_end   = grep(dia_out,"// <-- FOOTER START -->");
-        if body_end <> [] then
-            [dia_nl,dia_nc] = size(dia);
-            dia_out(body_end(1):dia_nl) = [];
-        end
-    endfunction
-
-    //createthefile
-    function msg = createthefile ( filename )
-        // Returns a 2-by-1 matrix of strings, containing a message such as:
-        //   Add or create the following file :
-        //   - C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.dia.ref
-        // Workaround for bug #4827
-        msg(1) = "   Add or create the following file : "
-        msg(2) = "   - "+filename
-    endfunction
-
-    // comparethefiles
-    function msg = comparethefiles ( filename1 , filename2 )
-        // Returns a 3-by-1 matrix of strings, containing a message such as:
-        //   Compare the following files :
-        //   - C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.dia
-        //   - C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.dia.ref
-        // Workaround for bug #4827
-        msg(1) = "   Compare the following files :"
-        msg(2) = "   - "+filename1
-        msg(3) = "   - "+filename2
-    endfunction
-
-    function directories = getDirectories(directory)
-        directories = directory;
-        items = gsort(listfiles(directory),"lr","i");
-
-        for i=1:size(items,"*")
-            if isdir(directory + items(i)) then
-                directories = [directories; getDirectories(directory + items(i) + filesep())];
-            end
-        end
-    endfunction
-
-    function name = splitModule(name)
-    if ~isempty( regexp(stripblanks(name),"/\|/") ) then
-        name = stripblanks( strsubst( strsplit(name,regexp(stripblanks(name),"/\|/")) , "/\|$/","","r" ) );
-    end
-    endfunction
-
-    function example = test_examples()
-        example = [ sprintf("Examples :\n\n") ];
-        example = [ example ; sprintf("// Launch all tests\n") ];
-        example = [ example ; sprintf("test_run();\n") ];
-        example = [ example ; sprintf("test_run([]);\n") ];
-        example = [ example ; sprintf("test_run([],[]);\n") ];
-        example = [ example ; "" ];
-        example = [ example ; sprintf("// Test one or several module\n") ];
-        example = [ example ; sprintf("test_run(''core'');\n") ];
-        example = [ example ; sprintf("test_run(''core'',[]);\n") ];
-        example = [ example ; sprintf("test_run([''core'',''string'']);\n") ];
-        example = [ example ; "" ];
-        example = [ example ; sprintf("// Launch one or several test in a specified module\n") ];
-        example = [ example ; sprintf("test_run(''core'',[''trycatch'',''opcode'']);\n") ];
-        example = [ example ; "" ];
-        example = [ example ; sprintf("// With options\n") ];
-        example = [ example ; sprintf("test_run([],[],''no_check_ref'');\n") ];
-        example = [ example ; sprintf("test_run([],[],''no_check_error_output'');\n") ];
-        example = [ example ; sprintf("test_run([],[],''create_ref'');\n") ];
-        example = [ example ; sprintf("test_run([],[],''list'');\n") ];
-        example = [ example ; sprintf("test_run([],[],''help'');\n") ];
-        example = [ example ; sprintf("test_run([],[],[''no_check_ref'',''mode_nw'']);\n") ];
-        example = [ example ; "" ];
-    endfunction
-
-    function newOption = clean_option(var, option)
-        newOption = var;
-        newOption(newOption == option) = [];
-    endfunction
-
-    function result = check_option(var, option)
-        result = or(var == option);
-    endfunction
-
-    function value = assign_option(var, option, truevalue, falsevalue)
-        if check_option(var, option) then
-            value = truevalue;
-        else
-            value = falsevalue;
-        end
-    endfunction
-
     lhs     = argn(1);
     rhs     = argn(2);
 
@@ -815,9 +60,9 @@ function test_run(varargin)
             params.testTypes = "nonreg_tests";
         end
 
-        clean_option(option_mat, "unit_tests");
-        clean_option(option_mat, "nonreg_tests");
-        clean_option(option_mat, "all_tests");
+        option_mat = clean_option(option_mat, "unit_tests");
+        option_mat = clean_option(option_mat, "nonreg_tests");
+        option_mat = clean_option(option_mat, "all_tests");
 
         // Skip tests
         params.skip_mat     = assign_option(option_mat, "skip_tests", varargin(2), params.skip_mat);
@@ -1027,3 +272,763 @@ function test_run(varargin)
     end
 endfunction
 
+function status = test_module(_params)
+
+    name = splitModule(_params.moduleName);
+    if with_module(name(1)) then
+        // It's a scilab internal module
+        module.path = pathconvert(SCI + "/modules/" + name(1), %F);
+    elseif or(librarieslist() == "atomslib") & atomsIsLoaded(name(1)) then
+        // It's an ATOMS module
+        module.path = pathconvert(atomsGetLoadedPath(name(1)) , %F, %T);
+    elseif isdir(name(1)) then
+        // It's an external module
+        module.path = pathconvert(name(1), %F);
+    else
+        // It's an error
+        error(sprintf(gettext("%s is not an installed module or toolbox"), name(1)));
+    end
+
+    //get tests from path
+    my_types = ["unit_tests","nonreg_tests"];
+
+    directories = [];
+    for i=1:size(my_types,"*")
+        if (_params.testTypes == "all_tests") | (_params.testTypes == my_types(i)) then
+            directory_path = module.path + "/tests/" + my_types(i);
+            for j=2:size(name,"*")
+                directory_path = directory_path + filesep() + name(j);
+            end
+
+            if isdir(directory_path) then
+                directories = [directories;getDirectories(directory_path + filesep())];
+            end
+        end
+    end
+
+    tests = [];
+    if( _params.tests_mat == [])
+        for i=1:size(directories, "*")
+            currentDir = directories(i);
+            tests_mat = gsort(basename(listfiles(currentDir + filesep() + "*.tst")),"lr","i");
+
+            for j = 1:size(tests_mat, "*")
+                if or(tests_mat(j) == _params.skip_mat) == %f then
+                    tests($+1, [1,2]) = [currentDir, tests_mat(j)];
+                end
+            end
+        end
+    else
+        //not empty tests_mat
+        for i = 1:size(_params.tests_mat, "*")
+            bFind = %f;
+            for j = 1:size(directories, "*")
+                currentDir = directories(j);
+                testFile = currentDir + filesep() + _params.tests_mat(i) + ".tst";
+                if isfile(testFile) then
+                    tests($+1, [1,2]) = [currentDir, _params.tests_mat(i)];
+                    bFind = %t;
+                end
+            end
+
+            if bFind == %f then
+                error(sprintf(gettext("The test ""%s"" is not available from the ""%s"" module"), _params.tests_mat(i), name(1)));
+            end
+        end
+    end
+
+    //initialize counter
+    details_failed      = "";
+    test_count          = size(tests, "r");
+    test_passed_count   = 0;
+    test_failed_count   = 0;
+    test_skipped_count  = 0;
+
+    moduleName          = _params.moduleName;
+    // Improve the display of the module
+    if isdir(moduleName) then
+        if part(moduleName,1:length(SCI)) == SCI then
+            moduleName = "SCI" + part(moduleName,length(SCI)+1:length(moduleName));
+        elseif part(moduleName,1:length(SCIHOME)) == SCIHOME then
+            moduleName = "SCIHOME" + part(moduleName,length(SCIHOME)+1:length(moduleName));
+        end
+    end
+
+    //don't test only return list of tests.
+    if _params.reference == "list" then
+        for i = 1:test_count
+            if size(name, "*") > 1 then
+                displayModuleName = sprintf("%s", name(1));
+                for j=2:size(name, "*")
+                    displayModuleName = displayModuleName + sprintf("|%s", name(j));
+                end
+            else
+                displayModuleName = sprintf("%s", name(1));
+            end
+            tests(i,1) = displayModuleName;
+        end
+        status.list         = tests;
+        status.test_count   = test_count;
+        return;
+    end
+
+    tic();
+    for i = 1:test_count
+        printf("   %03d/%03d - ",i, test_count);
+
+        if size(name, "*") > 1 then
+            displayModuleName = sprintf("[%s", name(1));
+            for j=2:size(name, "*")
+                displayModuleName = displayModuleName + sprintf("|%s", name(j));
+            end
+            displayModuleName = displayModuleName + sprintf("] %s", tests(i,2));
+        else
+            displayModuleName = sprintf("[%s] %s", name(1), tests(i,2));
+        end
+
+        printf("%s", displayModuleName);
+        for j = length(displayModuleName):50
+            printf(".");
+        end
+
+        result = test_single(_params, tests(i,1), tests(i,2));
+
+        if result.id == 0 then
+            printf("passed\n");
+            test_passed_count = test_passed_count + 1;
+        else
+            msg = sprintf(result.message);
+            printf("%s \n", msg(1));
+            for kline = 2:size(msg, "*")
+                printf(part(" ", 1:62) + "%s \n", msg(2));
+            end
+
+            if result.id < 10 then
+                //failed
+                test_failed_count = test_failed_count + 1;
+                details_failed = [ details_failed ; sprintf("   TEST : [%s] %s", _params.moduleName, tests(i,2))];
+                details_failed = [ details_failed ; sprintf("   %s", result.message) ];
+                details_failed = [ details_failed ; result.details ];
+                details_failed = [ details_failed ; "" ];
+            elseif (result.id >= 10) & (result.id < 20) then
+                // skipped
+                test_skipped_count = test_skipped_count + 1;
+            end
+        end
+    end
+
+    status.totalTime = toc();
+    clearglobal TICTOC;
+    status.test_passed_count  = test_passed_count;
+    status.test_failed_count  = test_failed_count;
+    status.test_skipped_count = test_skipped_count;
+
+    // Summary
+    status.test_count     = test_count;
+    status.details_failed   = details_failed;
+endfunction
+
+function status = test_single(_module, _testPath, _testName)
+    //option flag
+
+    skip          = %F;
+    interactive   = %F;
+    notyetfixed   = %F;
+    longtime      = %F;
+    reopened      = %F;
+    jvm           = %T;
+    graphic       = %F;
+    execMode      = "";
+    platform      = "all";
+    language      = "any";
+    try_catch     = %f;
+    error_output  = "check";
+    reference     = "check";
+    xcosNeeded    = %F;
+
+    //some paths
+    tmp_tst     = pathconvert( TMPDIR + "/" + _testName + ".tst", %F);
+    tmp_dia     = pathconvert( TMPDIR + "/" + _testName + ".dia.tmp", %F);
+    tmp_res     = pathconvert( TMPDIR + "/" + _testName + ".res", %F);
+    tmp_err     = pathconvert( TMPDIR + "/" + _testName + ".err", %F);
+    path_dia    = pathconvert( TMPDIR + "/" + _testName + ".dia", %F);
+
+    path_dia_ref  = _testPath + _testName + ".dia.ref";
+    // Reference file management OS by OS
+    if getos() == 'Windows' then
+        altreffile  = [ _testPath + _testName + ".win.dia.ref" ];
+    elseif getos() == 'Darwin' then
+        altreffile  = [ _testPath + _testName + ".unix.dia.ref" ; _testPath + _testName + ".macosx.dia.ref" ];
+    elseif getos() == 'Linux' then
+        altreffile  = [ _testPath + _testName + ".unix.dia.ref" ; _testPath + _testName + ".linux.dia.ref" ];
+    else
+        altreffile  = [ _testPath + _testName + ".unix.dia.ref" ];
+    end
+
+    for i=1:size(altreffile,"*")
+        if isfile(altreffile(i)) then
+            path_dia_ref = altreffile(i);
+        end
+    end
+
+    //output structure
+    status.id = 0;
+    status.message = "";
+    status.details = "";
+
+    //Reset standard globals
+    rand("seed",0);
+    rand("uniform");
+
+    //load file
+    testFile = _testPath + _testName + ".tst";
+    sciFile = mgetl(testFile);
+
+    //read options
+    if ~isempty(grep(sciFile, "<-- NOT FIXED -->")) then
+        status.id = 10;
+        status.message = "skipped: not yet fixed";
+        return;
+    end
+
+    if ~isempty(grep(sciFile, "<-- REOPENED -->")) then
+        status.id = 10;
+        status.message = "skipped: Bug reopened";
+        return;
+    end
+
+    // platform
+    if ~isempty(grep(sciFile, "<-- WINDOWS ONLY -->")) & getos() <> "Windows" then
+        status.id = 10;
+        status.message = "skipped: Windows only";
+        return;
+    end
+
+    if ~isempty(grep(sciFile, "<-- LINUX ONLY -->")) & getos() <> "Linux" then
+        status.id = 10;
+        status.message = "skipped: Linux only";
+        return;
+    end
+
+    if ~isempty(grep(sciFile, "<-- MACOSX ONLY -->")) & getos() <> "Darwin" then
+        status.id = 10;
+        status.message = "skipped: MacOSX only";
+        return;
+    end
+
+    // Test execution
+    if ~isempty(grep(sciFile, "<-- INTERACTIVE TEST -->")) then
+        status.id = 10;
+        status.message = "skipped: interactive test";
+        return;
+    end
+
+    if ~isempty(grep(sciFile, "<-- LONG TIME EXECUTION -->")) & ~_module.longtime then
+        status.id = 10;
+        status.message = "skipped: Long time duration";
+        return;
+    end
+
+    if ~isempty(grep(sciFile, "<-- TEST WITH GRAPHIC -->")) then
+        if _module.wanted_mode == "NWNI" then
+            status.id = 10;
+            status.message = "skipped: Test with graphic";
+            return;
+        end
+
+        graphic = %T;
+        jvm = %T;
+        execMode = "NW";
+    end
+
+    if ~isempty(grep(sciFile, "<-- JVM NOT MANDATORY -->")) then
+        jvm = %F;
+        execMode = "NWNI";
+    end
+
+    if ~isempty(grep(sciFile, "<-- XCOS TEST -->")) then
+        xcosNeeded = %T;
+        jvm = %T;
+    end
+
+    // Language
+    if ~isempty(grep(sciFile, "<-- FRENCH IMPOSED -->")) then
+        language = "fr_FR";
+    end
+
+
+    if ~isempty(grep(sciFile, "<-- ENGLISH IMPOSED -->")) then
+        language = "en_US";
+    end
+
+    // Test building
+    if ~isempty(grep(sciFile, "<-- NO TRY CATCH -->")) then
+        try_catch = %F;
+    end
+
+    // Test result
+    if ~isempty(grep(sciFile, "<-- NO CHECK ERROR OUTPUT -->")) then
+        error_output = "skip";
+    end
+
+    if ~isempty(grep(sciFile, "<-- NO CHECK REF -->")) then
+        reference = "skip";
+    end
+
+    //build real test file
+
+    // Do some modification in tst file
+    //replace "pause,end" by "bugmes();quit;end"
+    sciFile = strsubst(sciFile, "pause,end", "bugmes();quit;end");
+    sciFile = strsubst(sciFile, "pause, end", "bugmes();quit;end");
+    sciFile = strsubst(sciFile, "pause;end", "bugmes();quit;end");
+    sciFile = strsubst(sciFile, "pause; end", "bugmes();quit;end");
+
+    //to avoid suppression of input --> with prompts
+    sciFile = strsubst(sciFile, "-->", "@#>");
+    //remove halt calls
+    sciFile = strsubst(sciFile, "halt();", "");
+
+    // Build test header
+    head = [
+        "// <-- HEADER START -->";
+        "mode(3);" ;
+        "//lines(28,72);";
+        "//lines(0);" ;
+        "function %onprompt" ;
+        "   errmsg = ""<--""+""Error on the test script file""+""-->"";";
+        "   printf(""%s\n"",errmsg);"; 
+        "   lasterror()";  
+        "   exit;"; 
+        "endfunction" ;
+        "function []=bugmes(), printf(''error on test'');endfunction"
+        "tmpdirToPrint = msprintf(''TMPDIR1=''''%s'''''',TMPDIR);"
+    ]
+
+    if xcosNeeded then
+        head = [ head ; "loadXcosLibs();"];
+    end
+
+    if try_catch then
+        head = [ head ; "try" ];
+    end
+
+    head = [
+        head;
+        "diary(''" + tmp_dia + "'');";
+        "printf(''%s\n'',tmpdirToPrint);";
+        "// <-- HEADER END -->"
+    ];
+
+    // Build test footer
+    tail = [ "// <-- FOOTER START -->" ];
+
+    if try_catch then
+        tail = [ 
+            tail;
+            "catch";
+            "   errmsg = ""<--""+""Error on the test script file""+""-->"";";
+            "   printf(""%s\n"",errmsg);";
+            "   lasterror()";
+            "end";
+        ];
+    end
+
+    tail = [ tail; "diary(0);" ];
+
+    if graphic then
+        tail = [ tail; "xdel(winsid());sleep(1000);" ];
+    end
+
+    tail = [ tail; "exit(0);" ; "// <-- FOOTER END -->" ];
+
+    //Build final test
+    sciFile = [head ; sciFile ; tail];
+
+
+    //Build command to execute
+
+    //scilab path
+    if (getos() <> 'Windows') & ~isfile(SCI+"/bin/scilab") then
+        SCI_BIN = strsubst(SCI,'share/scilab','');
+    else
+        SCI_BIN = SCI;
+    end
+
+    //mode
+    if _module.wanted_mode == "NW" then
+        mode_arg = "-nw";
+        elseif _module.wanted_mode == "NWNI" then
+        mode_arg = "-nwni";
+    else
+        if execMode == "NWNI" then
+            mode_arg = "-nwni";
+            elseif execMode == "NW" then
+            mode_arg = "-nw";
+        else
+            mode_arg = "-nw";
+        end
+    end
+
+    //language
+    if language == "any" then
+        language_arg = "";
+    elseif getos() == 'Windows' then
+        language_arg = "-l "+ language;
+    else
+        language_arg = "LANG=" + language + " ";
+    end
+    loader_path = pathconvert(fullfile(_module.moduleName, 'loader.sce'), %f);
+
+    // Build final command
+    if getos() == 'Windows' then
+        if (isdir(_module.moduleName) & isfile(loader_path)) // external module not in Scilab
+            test_cmd = "( """ + SCI_BIN + "\bin\YaSp.exe" + """" + " " + mode_arg + " " + language_arg + " -nb -e ""exec(""""" + loader_path + """"");exec(""""" + tmp_tst + """"", -1);"" > """ + tmp_res + """ ) 2> """ + tmp_err + """";
+        else // standard module
+            test_cmd = "( """ + SCI_BIN + "\bin\YaSp.exe" + """" + " " + mode_arg + " " + language_arg + " -nb -e ""exec(""""" + tmp_tst + """"", -1);"" > """ + tmp_res + """ ) 2> """ + tmp_err + """";
+        end
+    else
+        if (isdir(_module.moduleName) & isfile(loader_path))
+            test_cmd = "( " + language_arg + " " + SCI_BIN + "/bin/scilab " + mode_arg + " -nb -e ""exec(''" + loader_path + "'');exec(''" + tmp_tst +"'');""" + " > " + tmp_res + " ) 2> " + tmp_err;
+        else
+            test_cmd = "( " + language_arg + " " + SCI_BIN + "/bin/scilab " + mode_arg + " -nb -f " + tmp_tst + " > " + tmp_res + " ) 2> " + tmp_err;
+        end
+    end
+
+    //clean previous tmp files
+    if isfile(tmp_tst) then
+        deletefile(tmp_tst);
+    end
+
+    if isfile(tmp_dia) then
+        deletefile(tmp_dia);
+    end
+
+    if isfile(tmp_res) then
+        deletefile(tmp_res);
+    end
+
+    if isfile(tmp_err) then
+        deletefile(tmp_err);
+    end
+
+    //create tmp test file
+    mputl(sciFile, tmp_tst);
+
+    //execute test
+    host(test_cmd);
+
+    //Check errors
+    if (error_output == "check") & (_module.error_output == "check") then
+        if getos() == "Darwin" then
+            tmp_errfile_info = fileinfo(tmp_err);
+            msg = "JavaVM: requested Java version (1.5) not available. Using Java at ""/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"" instead."
+
+            if ~isempty(tmp_errfile_info) then
+                txt = mgetl(tmp_err);
+                txt(txt==msg) = [];
+                if isempty(txt) then
+                    deletefile(tmp_err);
+                end
+            end
+        end
+
+        tmp_errfile_info = fileinfo(tmp_err);
+
+        if isfile(tmp_err) & tmp_errfile_info(1) <> 0 then
+            status.id = 5;
+            status.message = "failed: error_output not empty\n   Use ''no_check_error_output'' option to disable this check.";
+            status.details = checkthefile(tmp_err);
+            return;
+        end
+    end
+
+    //Process output files
+
+    //Get the dia file
+    if isfile(tmp_dia) then
+        dia = mgetl(tmp_dia);
+    else
+        status.id = 6;
+        status.message = "failed: the dia file is not correct";
+        status.details = checkthefile(tmp_dia);
+        return;
+    end
+
+    // To get TMPDIR value
+    tmpdir1_line = grep(dia, "TMPDIR1");
+    execstr(dia(tmpdir1_line));
+
+    //Check for execution errors
+    if try_catch & grep(dia,"<--Error on the test script file-->") <> [] then
+        details = [ checkthefile(tmp_dia); ..
+        launchthecommand(testFile)];
+        status.id = 3;
+        status.message = "failed: premature end of the test script";
+        status.details = details;
+        return;
+    end
+
+    // Remove Header and Footer
+    dia = remove_headers(dia);
+
+    //Check for execution errors
+    dia_tmp = dia;
+
+    // remove commented lines
+    dia_tmp(grep(dia_tmp, "//")) = [];
+
+    if try_catch & grep(dia_tmp, "!--error") <> [] then
+        details = [ checkthefile(tmp_dia); ..
+        launchthecommand(testFile) ];
+        status.id = 1;
+        status.message = "failed: the string (!--error) has been detected";
+        status.details = details;
+        return;
+    end
+
+
+    if grep(dia_tmp,"error on test")<>[] then
+        details = [ checkthefile(tmp_dia); ..
+        launchthecommand(testFile) ];
+        status.id = 2;
+        status.message = "failed: one or several tests failed";
+        status.details = details;
+        return;
+    end
+
+
+    if tmpdir1_line == [] then
+        status.id = 6;
+        status.message = "failed: the dia file is not correct";
+        status.details = checkthefile(tmp_dia);
+        return;
+    end
+
+
+    // Check the reference file only if check_ref (i.e. for the whole
+    // test sequence) is true and this_check_ref (i.e. for the specific current .tst)
+    // is true.
+
+    if (reference=="check") & (_module.reference=="check")  then
+        if isfile(path_dia_ref) == %f then
+            status.id = 5;
+            status.message = "failed: the ref file doesn''t exist\n   Use ''no_check_ref'' option to disable this check.";
+            status.details = createthefile(path_dia_ref);
+            return;
+        end
+    end
+
+    // Comparaison ref <--> dia
+
+    if ( (reference=="check") & (_module.reference=="check") ) | (_module.reference=="create") then
+        //  Do some modification in  dia file
+
+            
+        dia(grep(dia, "printf(''%s\n'',tmpdirToPrint);")) = [];
+        dia(grep(dia, "TMPDIR1")) = [];
+        dia(grep(dia, "diary(0)")) = [];
+
+        dia = strsubst(dia,TMPDIR ,"TMPDIR");
+        dia = strsubst(dia,TMPDIR1, "TMPDIR");
+
+        if getos() == 'Windows' then
+            dia = strsubst(dia, strsubst(TMPDIR, "\","/"), "TMPDIR");
+            dia = strsubst(dia, strsubst(TMPDIR1, "\","/"), "TMPDIR");
+            dia = strsubst(dia, strsubst(TMPDIR, "/","\"), "TMPDIR");
+            dia = strsubst(dia, strsubst(TMPDIR1, "/","\"), "TMPDIR");
+            dia = strsubst(dia, strsubst(getshortpathname(TMPDIR), "\","/"), "TMPDIR");
+            dia = strsubst(dia, strsubst(getshortpathname(TMPDIR1), "\","/"), "TMPDIR");
+            dia = strsubst(dia, getshortpathname(TMPDIR), "TMPDIR");
+            dia = strsubst(dia, getshortpathname(TMPDIR1), "TMPDIR");
+        end
+
+        dia = strsubst(dia, SCI, "SCI");
+
+        if getos() == 'Windows' then
+            dia = strsubst(dia, strsubst(SCI, "\","/"), "SCI");
+            dia = strsubst(dia, strsubst(SCI, "/","\"), "SCI");
+            dia = strsubst(dia, strsubst(getshortpathname(SCI), "\","/"), "SCI");
+            dia = strsubst(dia, getshortpathname(SCI), "SCI");
+        end
+
+        //suppress the prompts
+        dia = strsubst(dia, "-->", "");
+        dia = strsubst(dia, "@#>", "-->");
+        dia = strsubst(dia, "-1->", "");
+
+        //standardise  number display
+
+        // strsubst(dia, " .", "0.");
+        // strsubst(dia, "-.", "-0.")
+        // strsubst(dia, "E+", "D+");
+        // strsubst(dia, "E-", "D-");
+
+        //not to change the ref files
+        dia = strsubst(dia ,"bugmes();return", "bugmes();quit");
+
+        if _module.reference=="create" then
+            // Delete previous .dia.ref file
+            if isfile(path_dia_ref) then
+                deletefile(path_dia_ref)
+            end
+
+            mputl(dia, path_dia_ref);
+            status.id = 20;
+            status.message = "passed: ref created";
+            return;
+        else
+        // write down the resulting dia file
+            mputl(dia, path_dia);
+
+            //Check for diff with the .ref file
+            [u,ierr] = mopen(path_dia_ref, "r");
+            if ierr== 0 then //ref file exists
+                ref=mgetl(u);
+                mclose(u)
+
+                // suppress blank (diff -nw)
+                dia = strsubst(dia, ' ', '')
+                ref = strsubst(ref, ' ', '')
+
+                dia(find(dia == '')) = [];
+                ref(find(ref == '')) = [];
+
+                dia(find(dia == '')) = [];
+                ref(find(ref == '')) = [];
+
+                dia(find(part(dia, (1:2)) == "//")) = [];
+                ref(find(part(ref, (1:2)) == "//")) = [];
+
+                if or(ref <> dia) then
+                    status.id = 4;
+                    status.message = "failed: dia and ref are not equal";
+                    status.details = comparethefiles(path_dia, path_dia_ref);
+                    return;
+                end
+
+            else
+                error(sprintf(gettext("The ref file (%s) doesn''t exist"), path_dia_ref));
+            end
+        end
+    end
+endfunction
+
+// checkthefile
+function msg = checkthefile( filename )
+    // Returns a 2-by-1 matrix of strings, containing a message such as:
+    //   Check the following file :
+    //   - C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.tst
+    // Workaround for bug #4827
+    msg(1) = "   Check the following file :"
+    msg(2) = "   - "+filename
+endfunction
+
+// launchthecommand
+function msg = launchthecommand( filename )
+    // Returns a 2-by-1 matrix of strings, containing a message such as:
+    //   Or launch the following command :
+    //   - exec("C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.tst")
+    // Workaround for bug #4827
+    msg(1) = "   Or launch the following command :"
+    msg(2) = "   - exec(""" + filename + """);"
+endfunction
+
+// => remove header from the diary txt
+function dia_out = remove_headers(dia_in)
+    dia_out = dia_in;
+    body_start = grep(dia_out,"// <-- HEADER END -->");
+    if body_start <> [] then
+        dia_out(1:body_start(1)) = [];
+    end
+
+    body_end   = grep(dia_out,"// <-- FOOTER START -->");
+    if body_end <> [] then
+        [dia_nl,dia_nc] = size(dia);
+        dia_out(body_end(1):dia_nl) = [];
+    end
+endfunction
+
+//createthefile
+function msg = createthefile ( filename )
+    // Returns a 2-by-1 matrix of strings, containing a message such as:
+    //   Add or create the following file :
+    //   - C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.dia.ref
+    // Workaround for bug #4827
+    msg(1) = "   Add or create the following file : "
+    msg(2) = "   - "+filename
+endfunction
+
+// comparethefiles
+function msg = comparethefiles ( filename1 , filename2 )
+    // Returns a 3-by-1 matrix of strings, containing a message such as:
+    //   Compare the following files :
+    //   - C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.dia
+    //   - C:\path\scilab\modules\optimization\tests\unit_testseldermeadeldermead_configure.dia.ref
+    // Workaround for bug #4827
+    msg(1) = "   Compare the following files :"
+    msg(2) = "   - "+filename1
+    msg(3) = "   - "+filename2
+endfunction
+
+function directories = getDirectories(directory)
+    directories = directory;
+    items = gsort(listfiles(directory),"lr","i");
+
+    for i=1:size(items,"*")
+        if isdir(directory + items(i)) then
+            directories = [directories; getDirectories(directory + items(i) + filesep())];
+        end
+    end
+endfunction
+
+function name = splitModule(name)
+if ~isempty( regexp(stripblanks(name),"/\|/") ) then
+    name = stripblanks( strsubst( strsplit(name,regexp(stripblanks(name),"/\|/")) , "/\|$/","","r" ) );
+end
+endfunction
+
+function example = test_examples()
+    example = [ sprintf("Examples :\n\n") ];
+    example = [ example ; sprintf("// Launch all tests\n") ];
+    example = [ example ; sprintf("test_run();\n") ];
+    example = [ example ; sprintf("test_run([]);\n") ];
+    example = [ example ; sprintf("test_run([],[]);\n") ];
+    example = [ example ; "" ];
+    example = [ example ; sprintf("// Test one or several module\n") ];
+    example = [ example ; sprintf("test_run(''core'');\n") ];
+    example = [ example ; sprintf("test_run(''core'',[]);\n") ];
+    example = [ example ; sprintf("test_run([''core'',''string'']);\n") ];
+    example = [ example ; "" ];
+    example = [ example ; sprintf("// Launch one or several test in a specified module\n") ];
+    example = [ example ; sprintf("test_run(''core'',[''trycatch'',''opcode'']);\n") ];
+    example = [ example ; "" ];
+    example = [ example ; sprintf("// With options\n") ];
+    example = [ example ; sprintf("test_run([],[],''no_check_ref'');\n") ];
+    example = [ example ; sprintf("test_run([],[],''no_check_error_output'');\n") ];
+    example = [ example ; sprintf("test_run([],[],''create_ref'');\n") ];
+    example = [ example ; sprintf("test_run([],[],''list'');\n") ];
+    example = [ example ; sprintf("test_run([],[],''help'');\n") ];
+    example = [ example ; sprintf("test_run([],[],[''no_check_ref'',''mode_nw'']);\n") ];
+    example = [ example ; "" ];
+endfunction
+
+function newOption = clean_option(var, option)
+    newOption = var;
+    newOption(newOption == option) = [];
+endfunction
+
+function result = check_option(var, option)
+    result = or(var == option);
+endfunction
+
+function value = assign_option(var, option, truevalue, falsevalue)
+    if check_option(var, option) then
+        value = truevalue;
+    else
+        value = falsevalue;
+    end
+endfunction
+
+
index 9418ada..3c24171 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Antoine ELIAS
+ * Copyright (C) 2012 - DIGITEO - Antoine ELIAS
  *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
 #include "string.hxx"
 #include "container.hxx"
 #include "getmode.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
 
 extern "C"
 {
 #include "Scierror.h"
 #include "localization.h"
+#include "os_swprintf.h"
 }
 
 using namespace types;
@@ -37,9 +41,14 @@ Function::ReturnValue sci_size(types::typed_list &in, int _iRetCount, types::typ
     switch(in[0]->getType())
     {
         // Dedicated case for lists.
-    case InternalType::RealList:
     case InternalType::RealMList:
+        {
+            std::wstring wstFuncName = L"%"  + in[0]->getTypeStr() + L"_size";
+            Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+            break;
+        }
     case InternalType::RealTList:
+    case InternalType::RealList:
         {
             if(in.size() > 1)
             {
index ef68cda..c9cba92 100644 (file)
@@ -73,51 +73,59 @@ extern "C"
     }                                                          \
 }
 /*--------------------------------------------------------------------------*/
-void C2F(mgetnc)(int *fd, void * res, int *n1, char *type, int *ierr)
+void C2F(mgetnc)(int* fd, void* res, int* n1, char* type, int* ierr)
 {  
-  char c1,c2;
-  int i,items=*n1,n=*n1;
-  FILE *fa;
+    char c1;
+    char c2;
+    int i;
+    int items   = *n1;
+    int n       = *n1;
+    FILE* fa; // used in MGET_GEN_NC => MGET_NC
+    File* pFile = FileManager::getFile(*fd);
 
+    *ierr = 0;
 
-  *ierr=0;
-  if ((fa = GetFileOpenedInScilab(*fd)) ==NULL) {
-    sciprint(_("%s: No input file associated to logical unit %d.\n"),"mget",*fd);
-    *ierr=3;
-    return;
-  }
-  int swap = GetSwapStatus(*fd);
-  c1 = ( strlen(type) > 1) ? type[1] : ' '; 
-  c2 = ( strlen(type) > 2) ? type[2] : ' '; 
-  switch ( type[0] )
+    if(pFile == NULL || (fa = pFile->getFiledesc()) == NULL)
     {
-    case 'i' : MGET_GEN_NC(int,c1);    break;
-    case 'l' : MGET_GEN_NC(int32_t,c1);   break;
-    case 's' : MGET_GEN_NC(short,c1);  break;
-    case 'c' : MGET_CHAR_NC(char);     break;
-    case 'd' : MGET_GEN_NC(double,c1); break;
-    case 'f' : MGET_GEN_NC(float,c1);  break;
-    case 'u' :
-      switch ( c1 )
-       {
-       case 'i' :  MGET_GEN_NC(unsigned int,c2);   break;
-       case 'l' :  MGET_GEN_NC(uint32_t,c2);  break;
-       case 's' :  MGET_GEN_NC(unsigned short,c2); break;
-       case ' ' :  MGET_GEN_NC(unsigned int,' ');  break;
-       case 'c' :  MGET_CHAR_NC(unsigned char);    break;
-       default : *ierr=1; return; break;
-       }
-      break;
-    default :
-      *ierr=1;
-      return ;
+        sciprintW(_W("%ls: No input file associated to logical unit %d.\n"),L"mget",*fd);
+        *ierr=3;
+        return;
     }
-  if ( items != n ) 
+
+    c1 = (strlen(type) > 1) ? type[1] : ' ';
+    c2 = (strlen(type) > 2) ? type[2] : ' ';
+
+    int swap = pFile->getFileSwap(); // used in MGET_GEN_NC => MGET_NC
+
+    switch(type[0])
     {
-      *ierr = -(items) -1 ;
-      /** sciprint("Read %d out of\n",items,n); **/
+        case 'i' : MGET_GEN_NC(int,c1);    break;
+        case 'l' : MGET_GEN_NC(int32_t,c1);break;
+        case 's' : MGET_GEN_NC(short,c1);  break;
+        case 'c' : MGET_CHAR_NC(char);     break;
+        case 'd' : MGET_GEN_NC(double,c1); break;
+        case 'f' : MGET_GEN_NC(float,c1);  break;
+        case 'u' :
+            switch(c1)
+            {
+                case 'i' :  MGET_GEN_NC(unsigned int,c2);   break;
+                case 'l' :  MGET_GEN_NC(uint32_t,c2);       break;
+                case 's' :  MGET_GEN_NC(unsigned short,c2); break;
+                case ' ' :  MGET_GEN_NC(unsigned int,' ');  break;
+                case 'c' :  MGET_CHAR_NC(unsigned char);    break;
+                default : *ierr = 1; return;
+            }
+            break;
+        default : *ierr = 1; return;
     }
-  return;
+
+    if(items != n)
+    {
+        *ierr = -items - 1 ;
+        // sciprint("Read %d out of\n",items,n);
+    }
+
+    return;
 }
 /*--------------------------------------------------------------------------*/
 /* =================================================
index 46c3813..cb0ffad 100644 (file)
@@ -1,75 +1,5 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2007-2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- JVM NOT MANDATORY -->
-// =============================================================================
-// Unitary tests for mkdir function
-// =============================================================================
-// TEST 1 : absolute path with one input argument
-cd;
-test_1_dir = TMPDIR+"/mkdir_test_1";
-status_1   = mkdir(test_1_dir);
-if status_1 <> 1      then bugmes();quit;end
-if ~isdir(test_1_dir) then bugmes();quit;end
-// TEST 2 : absolute path with 2 input arguments
-cd;
-test_2_dir = TMPDIR+"/mkdir_test_2";
-status_2   = mkdir(TMPDIR,"mkdir_test_2");
-if status_2 <> 1      then bugmes();quit;end
-if ~isdir(test_2_dir) then bugmes();quit;end
-// TEST 3 : relative path
-cd TMPDIR;
-test_3_dir = TMPDIR+"/mkdir_test_3";
-status_3   = mkdir("mkdir_test_3");
-if status_3 <> 1          then bugmes();quit;end
-if ~isdir(test_3_dir)     then bugmes();quit;end
-if ~isdir("mkdir_test_3") then bugmes();quit;end
-// TEST 4 : relative path with sub-directory
-cd TMPDIR;
-test_4_dir = TMPDIR+"/mkdir_test_3/mkdir_test_4";
-status_4   = mkdir("mkdir_test_3/mkdir_test_4");
-if status_4 <> 1                       then bugmes();quit;end
-if ~isdir(test_4_dir)                  then bugmes();quit;end
-if ~isdir("mkdir_test_3/mkdir_test_4") then bugmes();quit;end
-// TEST 5 : Bad Case - The directory already exists
-cd;
-test_5_dir  =  test_1_dir;
-status_5    =  mkdir(test_5_dir);
-if status_5 <> 2 then bugmes();quit;end
-// TEST 6 : Bad Case - The file already exists
-cd;
-test_6_dir  =  TMPDIR+"/mkdir_test_6";
-[fd_6,err_6] = mopen(test_6_dir,"wb");
-mclose(fd_6);
-status_6    =  mkdir(test_6_dir);
-if status_6 <> -2 then bugmes();quit;end
-// TEST 7 : mkdir creates in the same instruction one folder and one subfolder.
-cd;
-test_7_dir  =  TMPDIR+"/mkdir_test_7/mkdir_test_7";
-status_7    =  mkdir(test_7_dir);
-if status_7 <> 1 then bugmes();quit;end
-removedir(test_1_dir);
-removedir(test_2_dir);
-removedir(test_3_dir);
-removedir(test_4_dir);
-removedir(test_5_dir);
-removedir(test_6_dir);
-removedir(test_7_dir);
-// TEST : error messages
-try
-  mkdir([])
-catch
-  [str,n]=lasterror();
-  if n <> 999 then bugmes();quit;end
-  if str <> msprintf(_("%s: Wrong type for input argument #%d: String expected.\n"), "mkdir", 1) then bugmes();quit;end
-end
-try
-  mkdir(["a", "b"])
-catch
-  [str,n]=lasterror();
-  if n <> 999 then bugmes();quit;end
-  if str <> msprintf(_("%s: Wrong size for input argument #%d: A string expected.\n"), "mkdir", 1) then bugmes();quit;end
-end
+
+removedir: Warning: Directory 'TMPDIR\mkdir_test_3\mkdir_test_4' doesn't exists.
+removedir: Warning: Directory 'TMPDIR\mkdir_test_1' doesn't exists.
+removedir: Warning: Directory 'TMPDIR\mkdir_test_6' doesn't exists.
+
index 4061636..fc424f4 100644 (file)
@@ -100,4 +100,10 @@ public :
    static int Load();
 };
 
+class SpreadsheetModule : public GenericModule
+{
+public :
+   static int Load();
+};
+
 #endif /* !__DYNAMIC_MODULES_HXX_ */
index 938d39e..fd4f1fa 100644 (file)
@@ -41,4 +41,5 @@
 //#include "../../statistics/includes/statistics_gw.hxx"
 #include "dynamic_modules.hxx"
 #include "../../differential_equations/includes/differential_equations_gw.hxx"
+#include "../../spreadsheet/includes/spreadsheet_gw.hxx"
 #endif /* !__MODULE_DECLARATION_HXX__ */
index f8f623c..5f71e0c 100644 (file)
@@ -284,3 +284,21 @@ int DifferentialEquationsModule::Load()
     return 1;
 }
 
+int SpreadsheetModule::Load()
+{
+    wstring wstModuleName = L"spreadsheet";
+#ifdef _MSC_VER
+    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_1);
+#else
+    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_3);
+#endif
+    vectGateway vect = loadGatewaysName(wstModuleName);
+
+    for(int i = 0 ; i < vect.size() ; i++)
+    {
+        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+    }
+
+    return 1;
+}
+
index 4a2a52d..f3fb124 100644 (file)
@@ -308,6 +308,7 @@ bool FuncManager::CreateModuleList(void)
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"linear_algebra", &LinearAlgebraModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"statistics", &StatisticsModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"differential_equations", &DifferentialEquationsModule::Load));
+    m_ModuleMap.insert(pair<wstring, GW_MOD>(L"spreadsheet", &SpreadsheetModule::Load));
 
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
index a4a0fe8..2ef6feb 100644 (file)
@@ -6,7 +6,8 @@
 
 SPREADSHEET_C_SOURCES = src/c/xls.c
 
-RIPOLE_SOURCES = src/c/ripole/olestream-unwrap.c \
+RIPOLE_SOURCES = \
+src/c/ripole/olestream-unwrap.c \
 src/c/ripole/pldstr.c \
 src/c/ripole/ole.c \
 src/c/ripole/bytedecoders.c \
@@ -15,21 +16,39 @@ src/c/ripole/ripole.c \
 src/c/ripole/bt-int.c
 
 
-GATEWAY_C_SOURCES = sci_gateway/c/gw_spreadsheet.c \
-sci_gateway/c/sci_xls_read.c \
-sci_gateway/c/sci_xls_open.c
-
-libscispreadsheet_la_CFLAGS=   -I$(srcdir)/includes/ \
-                               -I$(srcdir)/src/c/ \
-                               -I$(srcdir)/src/c/ripole \
-                               -I$(top_srcdir)/libs/MALLOC/includes/ \
-                               -I$(top_srcdir)/modules/output_stream/includes \
-                               -I$(top_srcdir)/modules/io/includes \
-                               -I$(top_srcdir)/modules/system_env/includes \
-                               -I$(top_srcdir)/modules/fileio/includes \
-                               -I$(top_srcdir)/modules/api_scilab/includes \
-                               -I$(top_srcdir)/modules/operations/includes \
-                               -I$(top_srcdir)/modules/string/includes
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/sci_xls_read.cpp \
+    sci_gateway/cpp/sci_xls_open.cpp
+
+libscispreadsheet_la_CFLAGS= \
+-I$(srcdir)/includes/ \
+-I$(srcdir)/src/c/ \
+-I$(srcdir)/src/c/ripole \
+-I$(top_srcdir)/libs/MALLOC/includes/ \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/io/includes \
+-I$(top_srcdir)/modules/system_env/includes \
+-I$(top_srcdir)/modules/fileio/includes \
+-I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/operations/includes \
+-I$(top_srcdir)/modules/string/includes
+
+libscispreadsheet_la_CPPFLAGS= \
+-I$(srcdir)/includes/ \
+-I$(srcdir)/src/cpp/ \
+-I$(srcdir)/src/c/ \
+-I$(srcdir)/src/c/ripole \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/dynamic_link/includes \
+-I$(top_srcdir)/modules/symbol/includes \
+-I$(top_srcdir)/modules/ast/includes \
+-I$(top_srcdir)/modules/threads/includes \
+-I$(top_srcdir)/modules/operations/includes \
+-I$(top_srcdir)/modules/system_env/includes \
+-I$(top_srcdir)/libs/dynamiclibrary/includes \
+-I$(top_srcdir)/modules/fileio/includes \
+-I$(top_srcdir)/modules/types/includes
 
 pkglib_LTLIBRARIES = libscispreadsheet.la
 noinst_LTLIBRARIES = libscispreadsheet-algo.la
@@ -37,11 +56,12 @@ noinst_LTLIBRARIES = libscispreadsheet-algo.la
 libscispreadsheet_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
 
 libscispreadsheet_algo_la_SOURCES = $(SPREADSHEET_C_SOURCES) $(RIPOLE_SOURCES)
-libscispreadsheet_la_SOURCES = $(GATEWAY_C_SOURCES)
+libscispreadsheet_la_SOURCES = $(GATEWAY_CPP_SOURCES)
 libscispreadsheet_algo_la_CFLAGS = $(libscispreadsheet_la_CFLAGS)
+libscispreadsheet_algo_la_CPPFLAGS = $(libscispreadsheet_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC= $(SPREADSHEET_C_SOURCES) $(GATEWAY_C_SOURCES) $(RIPOLE_SOURCES)
+CHECK_SRC= $(SPREADSHEET_C_SOURCES) $(GATEWAY_CPP_SOURCES) $(RIPOLE_SOURCES)
 INCLUDE_FLAGS = $(libscispreadsheet_la_CFLAGS)
 
 libscispreadsheet_la_LIBADD = libscispreadsheet-algo.la 
index 51c9d69..8c35d17 100644 (file)
@@ -127,15 +127,13 @@ libscispreadsheet_algo_la_LINK = $(LIBTOOL) --tag=CC \
        $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
 libscispreadsheet_la_DEPENDENCIES = libscispreadsheet-algo.la
-am__objects_3 = libscispreadsheet_la-gw_spreadsheet.lo \
-       libscispreadsheet_la-sci_xls_read.lo \
+am__objects_3 = libscispreadsheet_la-sci_xls_read.lo \
        libscispreadsheet_la-sci_xls_open.lo
 am_libscispreadsheet_la_OBJECTS = $(am__objects_3)
 libscispreadsheet_la_OBJECTS = $(am_libscispreadsheet_la_OBJECTS)
-libscispreadsheet_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=link $(CCLD) \
-       $(libscispreadsheet_la_CFLAGS) $(CFLAGS) \
-       $(libscispreadsheet_la_LDFLAGS) $(LDFLAGS) -o $@
+libscispreadsheet_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(libscispreadsheet_la_LDFLAGS) $(LDFLAGS) -o $@
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -149,6 +147,15 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(libscispreadsheet_algo_la_SOURCES) \
        $(libscispreadsheet_la_SOURCES)
 DIST_SOURCES = $(libscispreadsheet_algo_la_SOURCES) \
@@ -418,7 +425,8 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
 SPREADSHEET_C_SOURCES = src/c/xls.c
-RIPOLE_SOURCES = src/c/ripole/olestream-unwrap.c \
+RIPOLE_SOURCES = \
+src/c/ripole/olestream-unwrap.c \
 src/c/ripole/pldstr.c \
 src/c/ripole/ole.c \
 src/c/ripole/bytedecoders.c \
@@ -426,31 +434,50 @@ src/c/ripole/logger.c \
 src/c/ripole/ripole.c \
 src/c/ripole/bt-int.c
 
-GATEWAY_C_SOURCES = sci_gateway/c/gw_spreadsheet.c \
-sci_gateway/c/sci_xls_read.c \
-sci_gateway/c/sci_xls_open.c
-
-libscispreadsheet_la_CFLAGS = -I$(srcdir)/includes/ \
-                               -I$(srcdir)/src/c/ \
-                               -I$(srcdir)/src/c/ripole \
-                               -I$(top_srcdir)/libs/MALLOC/includes/ \
-                               -I$(top_srcdir)/modules/output_stream/includes \
-                               -I$(top_srcdir)/modules/io/includes \
-                               -I$(top_srcdir)/modules/system_env/includes \
-                               -I$(top_srcdir)/modules/fileio/includes \
-                               -I$(top_srcdir)/modules/api_scilab/includes \
-                               -I$(top_srcdir)/modules/operations/includes \
-                               -I$(top_srcdir)/modules/string/includes
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/sci_xls_read.cpp \
+    sci_gateway/cpp/sci_xls_open.cpp
+
+libscispreadsheet_la_CFLAGS = \
+-I$(srcdir)/includes/ \
+-I$(srcdir)/src/c/ \
+-I$(srcdir)/src/c/ripole \
+-I$(top_srcdir)/libs/MALLOC/includes/ \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/io/includes \
+-I$(top_srcdir)/modules/system_env/includes \
+-I$(top_srcdir)/modules/fileio/includes \
+-I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/operations/includes \
+-I$(top_srcdir)/modules/string/includes
+
+libscispreadsheet_la_CPPFLAGS = \
+-I$(srcdir)/includes/ \
+-I$(srcdir)/src/cpp/ \
+-I$(srcdir)/src/c/ \
+-I$(srcdir)/src/c/ripole \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/dynamic_link/includes \
+-I$(top_srcdir)/modules/symbol/includes \
+-I$(top_srcdir)/modules/ast/includes \
+-I$(top_srcdir)/modules/threads/includes \
+-I$(top_srcdir)/modules/operations/includes \
+-I$(top_srcdir)/modules/system_env/includes \
+-I$(top_srcdir)/libs/dynamiclibrary/includes \
+-I$(top_srcdir)/modules/fileio/includes \
+-I$(top_srcdir)/modules/types/includes
 
 pkglib_LTLIBRARIES = libscispreadsheet.la
 noinst_LTLIBRARIES = libscispreadsheet-algo.la
 libscispreadsheet_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
 libscispreadsheet_algo_la_SOURCES = $(SPREADSHEET_C_SOURCES) $(RIPOLE_SOURCES)
-libscispreadsheet_la_SOURCES = $(GATEWAY_C_SOURCES)
+libscispreadsheet_la_SOURCES = $(GATEWAY_CPP_SOURCES)
 libscispreadsheet_algo_la_CFLAGS = $(libscispreadsheet_la_CFLAGS)
+libscispreadsheet_algo_la_CPPFLAGS = $(libscispreadsheet_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC = $(SPREADSHEET_C_SOURCES) $(GATEWAY_C_SOURCES) $(RIPOLE_SOURCES)
+CHECK_SRC = $(SPREADSHEET_C_SOURCES) $(GATEWAY_CPP_SOURCES) $(RIPOLE_SOURCES)
 INCLUDE_FLAGS = $(libscispreadsheet_la_CFLAGS)
 libscispreadsheet_la_LIBADD = libscispreadsheet-algo.la 
 
@@ -534,7 +561,7 @@ HELP_CHAPTERLANG = en_US fr_FR pt_BR
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .sci .bin .c .lo .o .obj
+.SUFFIXES: .sci .bin .c .cpp .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -624,7 +651,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-pldstr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-ripole.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-xls.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-gw_spreadsheet.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-sci_xls_open.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-sci_xls_read.Plo@am__quote@
 
@@ -650,81 +676,95 @@ distclean-compile:
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
 
 libscispreadsheet_algo_la-xls.lo: src/c/xls.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-xls.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-xls.Tpo -c -o libscispreadsheet_algo_la-xls.lo `test -f 'src/c/xls.c' || echo '$(srcdir)/'`src/c/xls.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-xls.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-xls.Tpo -c -o libscispreadsheet_algo_la-xls.lo `test -f 'src/c/xls.c' || echo '$(srcdir)/'`src/c/xls.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-xls.Tpo $(DEPDIR)/libscispreadsheet_algo_la-xls.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/xls.c' object='libscispreadsheet_algo_la-xls.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-xls.lo `test -f 'src/c/xls.c' || echo '$(srcdir)/'`src/c/xls.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-xls.lo `test -f 'src/c/xls.c' || echo '$(srcdir)/'`src/c/xls.c
 
 libscispreadsheet_algo_la-olestream-unwrap.lo: src/c/ripole/olestream-unwrap.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-olestream-unwrap.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-olestream-unwrap.Tpo -c -o libscispreadsheet_algo_la-olestream-unwrap.lo `test -f 'src/c/ripole/olestream-unwrap.c' || echo '$(srcdir)/'`src/c/ripole/olestream-unwrap.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-olestream-unwrap.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-olestream-unwrap.Tpo -c -o libscispreadsheet_algo_la-olestream-unwrap.lo `test -f 'src/c/ripole/olestream-unwrap.c' || echo '$(srcdir)/'`src/c/ripole/olestream-unwrap.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-olestream-unwrap.Tpo $(DEPDIR)/libscispreadsheet_algo_la-olestream-unwrap.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ripole/olestream-unwrap.c' object='libscispreadsheet_algo_la-olestream-unwrap.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-olestream-unwrap.lo `test -f 'src/c/ripole/olestream-unwrap.c' || echo '$(srcdir)/'`src/c/ripole/olestream-unwrap.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-olestream-unwrap.lo `test -f 'src/c/ripole/olestream-unwrap.c' || echo '$(srcdir)/'`src/c/ripole/olestream-unwrap.c
 
 libscispreadsheet_algo_la-pldstr.lo: src/c/ripole/pldstr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-pldstr.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-pldstr.Tpo -c -o libscispreadsheet_algo_la-pldstr.lo `test -f 'src/c/ripole/pldstr.c' || echo '$(srcdir)/'`src/c/ripole/pldstr.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-pldstr.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-pldstr.Tpo -c -o libscispreadsheet_algo_la-pldstr.lo `test -f 'src/c/ripole/pldstr.c' || echo '$(srcdir)/'`src/c/ripole/pldstr.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-pldstr.Tpo $(DEPDIR)/libscispreadsheet_algo_la-pldstr.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ripole/pldstr.c' object='libscispreadsheet_algo_la-pldstr.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-pldstr.lo `test -f 'src/c/ripole/pldstr.c' || echo '$(srcdir)/'`src/c/ripole/pldstr.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-pldstr.lo `test -f 'src/c/ripole/pldstr.c' || echo '$(srcdir)/'`src/c/ripole/pldstr.c
 
 libscispreadsheet_algo_la-ole.lo: src/c/ripole/ole.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-ole.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-ole.Tpo -c -o libscispreadsheet_algo_la-ole.lo `test -f 'src/c/ripole/ole.c' || echo '$(srcdir)/'`src/c/ripole/ole.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-ole.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-ole.Tpo -c -o libscispreadsheet_algo_la-ole.lo `test -f 'src/c/ripole/ole.c' || echo '$(srcdir)/'`src/c/ripole/ole.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-ole.Tpo $(DEPDIR)/libscispreadsheet_algo_la-ole.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ripole/ole.c' object='libscispreadsheet_algo_la-ole.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-ole.lo `test -f 'src/c/ripole/ole.c' || echo '$(srcdir)/'`src/c/ripole/ole.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-ole.lo `test -f 'src/c/ripole/ole.c' || echo '$(srcdir)/'`src/c/ripole/ole.c
 
 libscispreadsheet_algo_la-bytedecoders.lo: src/c/ripole/bytedecoders.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-bytedecoders.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-bytedecoders.Tpo -c -o libscispreadsheet_algo_la-bytedecoders.lo `test -f 'src/c/ripole/bytedecoders.c' || echo '$(srcdir)/'`src/c/ripole/bytedecoders.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-bytedecoders.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-bytedecoders.Tpo -c -o libscispreadsheet_algo_la-bytedecoders.lo `test -f 'src/c/ripole/bytedecoders.c' || echo '$(srcdir)/'`src/c/ripole/bytedecoders.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-bytedecoders.Tpo $(DEPDIR)/libscispreadsheet_algo_la-bytedecoders.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ripole/bytedecoders.c' object='libscispreadsheet_algo_la-bytedecoders.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-bytedecoders.lo `test -f 'src/c/ripole/bytedecoders.c' || echo '$(srcdir)/'`src/c/ripole/bytedecoders.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-bytedecoders.lo `test -f 'src/c/ripole/bytedecoders.c' || echo '$(srcdir)/'`src/c/ripole/bytedecoders.c
 
 libscispreadsheet_algo_la-logger.lo: src/c/ripole/logger.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-logger.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-logger.Tpo -c -o libscispreadsheet_algo_la-logger.lo `test -f 'src/c/ripole/logger.c' || echo '$(srcdir)/'`src/c/ripole/logger.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-logger.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-logger.Tpo -c -o libscispreadsheet_algo_la-logger.lo `test -f 'src/c/ripole/logger.c' || echo '$(srcdir)/'`src/c/ripole/logger.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-logger.Tpo $(DEPDIR)/libscispreadsheet_algo_la-logger.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ripole/logger.c' object='libscispreadsheet_algo_la-logger.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-logger.lo `test -f 'src/c/ripole/logger.c' || echo '$(srcdir)/'`src/c/ripole/logger.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-logger.lo `test -f 'src/c/ripole/logger.c' || echo '$(srcdir)/'`src/c/ripole/logger.c
 
 libscispreadsheet_algo_la-ripole.lo: src/c/ripole/ripole.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-ripole.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-ripole.Tpo -c -o libscispreadsheet_algo_la-ripole.lo `test -f 'src/c/ripole/ripole.c' || echo '$(srcdir)/'`src/c/ripole/ripole.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-ripole.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-ripole.Tpo -c -o libscispreadsheet_algo_la-ripole.lo `test -f 'src/c/ripole/ripole.c' || echo '$(srcdir)/'`src/c/ripole/ripole.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-ripole.Tpo $(DEPDIR)/libscispreadsheet_algo_la-ripole.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ripole/ripole.c' object='libscispreadsheet_algo_la-ripole.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-ripole.lo `test -f 'src/c/ripole/ripole.c' || echo '$(srcdir)/'`src/c/ripole/ripole.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-ripole.lo `test -f 'src/c/ripole/ripole.c' || echo '$(srcdir)/'`src/c/ripole/ripole.c
 
 libscispreadsheet_algo_la-bt-int.lo: src/c/ripole/bt-int.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-bt-int.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-bt-int.Tpo -c -o libscispreadsheet_algo_la-bt-int.lo `test -f 'src/c/ripole/bt-int.c' || echo '$(srcdir)/'`src/c/ripole/bt-int.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-bt-int.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-bt-int.Tpo -c -o libscispreadsheet_algo_la-bt-int.lo `test -f 'src/c/ripole/bt-int.c' || echo '$(srcdir)/'`src/c/ripole/bt-int.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-bt-int.Tpo $(DEPDIR)/libscispreadsheet_algo_la-bt-int.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ripole/bt-int.c' object='libscispreadsheet_algo_la-bt-int.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-bt-int.lo `test -f 'src/c/ripole/bt-int.c' || echo '$(srcdir)/'`src/c/ripole/bt-int.c
-
-libscispreadsheet_la-gw_spreadsheet.lo: sci_gateway/c/gw_spreadsheet.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_la-gw_spreadsheet.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_la-gw_spreadsheet.Tpo -c -o libscispreadsheet_la-gw_spreadsheet.lo `test -f 'sci_gateway/c/gw_spreadsheet.c' || echo '$(srcdir)/'`sci_gateway/c/gw_spreadsheet.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_la-gw_spreadsheet.Tpo $(DEPDIR)/libscispreadsheet_la-gw_spreadsheet.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/gw_spreadsheet.c' object='libscispreadsheet_la-gw_spreadsheet.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_la-gw_spreadsheet.lo `test -f 'sci_gateway/c/gw_spreadsheet.c' || echo '$(srcdir)/'`sci_gateway/c/gw_spreadsheet.c
-
-libscispreadsheet_la-sci_xls_read.lo: sci_gateway/c/sci_xls_read.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_la-sci_xls_read.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_la-sci_xls_read.Tpo -c -o libscispreadsheet_la-sci_xls_read.lo `test -f 'sci_gateway/c/sci_xls_read.c' || echo '$(srcdir)/'`sci_gateway/c/sci_xls_read.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_la-sci_xls_read.Tpo $(DEPDIR)/libscispreadsheet_la-sci_xls_read.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_xls_read.c' object='libscispreadsheet_la-sci_xls_read.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_la-sci_xls_read.lo `test -f 'sci_gateway/c/sci_xls_read.c' || echo '$(srcdir)/'`sci_gateway/c/sci_xls_read.c
-
-libscispreadsheet_la-sci_xls_open.lo: sci_gateway/c/sci_xls_open.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_la_CFLAGS) $(CFLAGS) -MT libscispreadsheet_la-sci_xls_open.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_la-sci_xls_open.Tpo -c -o libscispreadsheet_la-sci_xls_open.lo `test -f 'sci_gateway/c/sci_xls_open.c' || echo '$(srcdir)/'`sci_gateway/c/sci_xls_open.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_la-sci_xls_open.Tpo $(DEPDIR)/libscispreadsheet_la-sci_xls_open.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_xls_open.c' object='libscispreadsheet_la-sci_xls_open.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_la-sci_xls_open.lo `test -f 'sci_gateway/c/sci_xls_open.c' || echo '$(srcdir)/'`sci_gateway/c/sci_xls_open.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscispreadsheet_algo_la_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-bt-int.lo `test -f 'src/c/ripole/bt-int.c' || echo '$(srcdir)/'`src/c/ripole/bt-int.c
+
+.cpp.o:
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@  $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+libscispreadsheet_la-sci_xls_read.lo: sci_gateway/cpp/sci_xls_read.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscispreadsheet_la-sci_xls_read.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_la-sci_xls_read.Tpo -c -o libscispreadsheet_la-sci_xls_read.lo `test -f 'sci_gateway/cpp/sci_xls_read.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_xls_read.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscispreadsheet_la-sci_xls_read.Tpo $(DEPDIR)/libscispreadsheet_la-sci_xls_read.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_xls_read.cpp' object='libscispreadsheet_la-sci_xls_read.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscispreadsheet_la-sci_xls_read.lo `test -f 'sci_gateway/cpp/sci_xls_read.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_xls_read.cpp
+
+libscispreadsheet_la-sci_xls_open.lo: sci_gateway/cpp/sci_xls_open.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscispreadsheet_la-sci_xls_open.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_la-sci_xls_open.Tpo -c -o libscispreadsheet_la-sci_xls_open.lo `test -f 'sci_gateway/cpp/sci_xls_open.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_xls_open.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscispreadsheet_la-sci_xls_open.Tpo $(DEPDIR)/libscispreadsheet_la-sci_xls_open.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_xls_open.cpp' object='libscispreadsheet_la-sci_xls_open.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscispreadsheet_la-sci_xls_open.lo `test -f 'sci_gateway/cpp/sci_xls_open.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_xls_open.cpp
 
 mostlyclean-libtool:
        -rm -f *.lo
diff --git a/scilab/modules/spreadsheet/includes/spreadsheet_gw.hxx b/scilab/modules/spreadsheet/includes/spreadsheet_gw.hxx
new file mode 100644 (file)
index 0000000..e17eef7
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2011 - DIGITEO - Cedric DELAMARRE
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#ifndef __SPREADSHEET_GW_HXX__
+#define __SPREADSHEET_GW_HXX__
+
+#include "cpp_gateway_prototype.hxx"
+
+extern "C"
+{
+#include "dynlib_spreadsheet.h"
+}
+
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_xls_open, SPREADSHEET_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_xls_read, SPREADSHEET_IMPEXP);
+
+#endif /* !__SPREADSHEET_GW_HXX__ */
index ae0881c..daa163a 100644 (file)
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
 function sheets=readxls(fil)
-  if argn(2)==1 then opt=1,end
-  fil=pathconvert(fil,%f,%t)
-  sheets=mlist(['xls','sheets'],list())
-  [fd,Text,Sheetnames,Abspos]=xls_open(fil)
-  Text=['', Text];
-  for k=1:size(Abspos,'*')
-    [Value,TextInd]=xls_read(fd,Abspos(k))
-    if Value==[] then
-      sheet=mlist(['xlssheet','name','text','value'],Sheetnames(k),[],Value)
-    else
-      if size(Text,'*')==1 then
-       T=emptystr(Value)
-      else
-       T=matrix(Text(TextInd+1),size(Value))
-      end
-      sheet=mlist(['xlssheet','name','text','value'],Sheetnames(k),T,Value)
+    if argn(2)==1 then
+        opt=1;
     end
-    sheets.sheets($+1)= sheet
-  end
-  mclose(fd)
+    
+    fil=pathconvert(fil,%f,%t);
+    sheets=mlist(['xls','sheets'],list());
+    [fd,Text,Sheetnames,Abspos]=xls_open(fil);
+    Text=['', Text];
+    
+    for k=1:size(Abspos,'*')
+        [Value,TextInd]=xls_read(fd,Abspos(k));
+        if Value==[] then
+            sheet = mlist(['xlssheet','name','text','value'],Sheetnames(k),[],Value)
+        else
+            if size(Text,'*')==1 then
+                T=emptystr(Value);
+            else
+                T=matrix(Text(TextInd+1),size(Value));
+            end
+            
+            sheet=mlist(['xlssheet','name','text','value'],Sheetnames(k),T,Value);
+        end
+        sheets.sheets($+1) = sheet;
+    end
+
+    mclose(fd)
 endfunction
diff --git a/scilab/modules/spreadsheet/sci_gateway/cpp/sci_xls_open.cpp b/scilab/modules/spreadsheet/sci_gateway/cpp/sci_xls_open.cpp
new file mode 100644 (file)
index 0000000..ded064c
--- /dev/null
@@ -0,0 +1,315 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+* Copyright (C) 2005-2008 - INRIA - Pierrick MODE
+* Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+* Copyright (C) 2011 - DIGITEO - Cedric DELAMARRE
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include "spreadsheet_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "double.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "xls.h"
+#include "ole.h"
+#include "ripole.h"
+#include "expandPathVariable.h"
+#include "mopen.h"
+#include "sci_tmpdir.h"
+#include "freeArrayOfString.h"
+#include "FileExist.h"
+}
+/*--------------------------------------------------------------------------*/
+static wchar_t* xls_basename(wchar_t* name);
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_xls_open(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+
+#undef IN
+       #define max_char_xls_open 256
+
+    // input
+    types::String* pStrPath = NULL;
+    wchar_t* filename_IN    = NULL;
+
+    wchar_t TMP[max_char_xls_open];
+    wchar_t* TMPDIR = NULL;
+
+       char **sst          = NULL;
+       char **Sheetnames   = NULL;
+
+    int iId     = 0;
+    int iSwap   = 0;
+    int iErr    = 0;
+    int ns      = 0;
+       int* Abspos = NULL;
+       int nsheets = 0;
+
+    wchar_t sep[2];
+#ifdef _MSC_VER
+       sep[0]=L'\\';
+#else
+       sep[0]=L'/';
+#endif
+       sep[1]=L'\0';
+
+    // *** check the minimal number of input args. ***
+    if(in.size() > 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"xls_open", 1);
+        return types::Function::Error;
+    }
+
+    // *** check number of output args according the methode. ***
+    if(_iRetCount != 4)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"xls_open", 4);
+        return types::Function::Error;
+    }
+
+    // *** check type of input args and get it. ***
+    // path
+    if(in[0]->isString() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A string expected.\n"), L"xls_open", 1);
+        return types::Function::Error;
+    }
+
+    pStrPath = in[0]->getAs<types::String>();
+    filename_IN = expandPathVariableW(pStrPath->get(0));
+
+    // *** Perform operation. ***
+    if(filename_IN)
+    {
+        /* bug 5615 */
+        /* remove blank characters @ the end */
+        int len =(int)wcslen(filename_IN);
+        int i = 0;
+
+        if (len >= 1)
+        {
+            for (i = len - 1; i >= 0  ; i--)
+            {
+                if (filename_IN[i] != ' ')
+                {
+                    break;
+                }
+
+                filename_IN[i] = '\0';
+            }
+        }
+
+        if (FileExistW(filename_IN) == false)
+        {
+            ScierrorW(999,_W("The file %ls does not exist.\n"), filename_IN);
+            return types::Function::Error;
+        }
+    }
+
+    TMPDIR = getTMPDIRW();
+    wcscpy(TMP, TMPDIR);
+
+    if(TMPDIR)
+    {
+        FREE(TMPDIR);
+        TMPDIR=NULL;
+    }
+
+    wcscat(TMP,sep);
+    wcscat(TMP,xls_basename(filename_IN));
+
+    char* tmp = wide_string_to_UTF8(TMP);
+    char* filename_in = wide_string_to_UTF8(filename_IN);
+    int result = ripole(filename_in, tmp, 0, 0);
+    free(tmp);
+    free(filename_in);
+
+    if(result != OLE_OK) 
+    {
+        if(result == OLEER_NO_INPUT_FILE) 
+        {
+            ScierrorW(999,_W("%ls: The file %ls does not exist.\n"), L"xls_open", filename_IN);
+        }
+        else if(result == OLEER_NOT_OLE_FILE || 
+                result == OLEER_INSANE_OLE_FILE || 
+                result == OLEER_LOADFAT_BAD_BOUNDARY || 
+                result == OLEER_MINIFAT_READ_FAIL || 
+                result == OLEER_PROPERTIES_READ_FAIL)
+        {
+            ScierrorW(999,_W("%ls: File %ls is not an ole2 file.\n"), L"xls_open", filename_IN);
+        }
+        else if(result == -1)
+        {
+            ScierrorW(999,_W("%ls: Cannot open file %ls.\n"), L"xls_open", filename_IN);
+        }
+
+        if(filename_IN)
+        {
+            FREE(filename_IN);
+            filename_IN = NULL;
+        }
+
+        return types::Function::Error;
+    }
+
+    wcscat(TMP, sep);
+    wcscat(TMP, L"Workbook");
+
+    iErr = mopen(TMP, L"rb", iSwap, &iId);
+    if(iErr != MOPEN_NO_ERROR)
+    {
+               sciprintW(_W("There is no xls stream in the ole2 file %ls.\n"), filename_IN);
+        if(iErr == MOPEN_CAN_NOT_OPEN_FILE)
+        {
+            ScierrorW(999, _W("%ls: Cannot open file %ls.\n"), L"xls_open", TMP);
+        }
+        else if(iErr == MOPEN_INVALID_FILENAME)
+        {
+            ScierrorW(999,_W("%ls: invalid filename.\n"), L"xls_open");
+        }
+        else //if(iErr == MOPEN_INVALID_STATUS)
+        {
+            ScierrorW(999,_W("%ls: invalid status.\n"), L"xls_open");
+        }
+
+        FREE(TMP);
+        FREE(filename_IN);
+        return types::Function::Error;
+    }
+
+    if(filename_IN)
+    {
+        FREE(filename_IN);
+        filename_IN = NULL;
+    }
+
+    xls_open(&iErr, &iId, &sst ,&ns, &Sheetnames, &Abspos, &nsheets);
+
+/*return *err:
+0 = OK
+1 = not an OLE file
+2 = no Workbook included
+3 = memory allocation problem
+4 = incorrect file
+5 = not a BIFF8 xls file
+*/
+    switch(iErr)
+    {
+        case 0:
+        /* OK */
+        break;
+
+        case 1:
+            ScierrorW(999,_W("%ls: Not an ole2 file.\n"),L"xls_open");
+            return types::Function::Error;
+            break;
+
+        case 2:
+            ScierrorW(999,_W("%ls: The file has no Workbook directory.\n"),L"xls_open");
+            return types::Function::Error;
+            break;
+
+        case 3:
+            ScierrorW(999,_W("%ls: No more memory.\n"),L"xls_open");
+            return types::Function::Error;
+            break;
+
+        case 4:
+            ScierrorW(990,_W("%ls: Incorrect or corrupted file.\n"),L"xls_open");
+            return types::Function::Error;
+            break;
+
+        case 5:
+            ScierrorW(999,_W("%ls: Only BIFF8 file format is handled.\n"),L"xls_open");
+            return types::Function::Error;
+            break;
+
+        default :
+            break;
+    }
+
+// *** Return result in Scilab. ***
+    types::Double* pDblId = new types::Double(static_cast<double>(iId));
+    out.push_back(pDblId);
+
+    if(ns)
+    {
+        /* Create a typed list to return the properties */
+        types::String* pStrSst = new types::String(1, ns);
+        for(int i = 0; i < ns; i++)
+        {
+            wchar_t* wcssst = to_wide_string(sst[i]);
+            pStrSst->set(i, wcssst);
+            free(wcssst);
+        }
+        freeArrayOfString(sst, ns);
+        out.push_back(pStrSst);
+    }
+    else
+    {
+        out.push_back(types::Double::Empty());
+    }
+
+    if(nsheets) 
+    {
+        /* Create a typed list to return the properties */
+        types::String* pStrSheets = new types::String(1, nsheets);
+        for(int i = 0; i < nsheets; i++)
+        {
+            wchar_t* wcssheet = to_wide_string(Sheetnames[i]);
+            pStrSheets->set(i, wcssheet);
+            free(wcssheet);
+        }
+        freeArrayOfString(Sheetnames, nsheets);
+        out.push_back(pStrSheets);
+
+        if(Abspos)
+        {
+            types::Double* pDblAbsPos = new types::Double(1, nsheets);
+            for(int i = 0; i < nsheets; i++)
+            {
+                pDblAbsPos->set(i, static_cast<double>(Abspos[i]));
+            }
+            out.push_back(pDblAbsPos);
+            free(Abspos);
+            Abspos = NULL;
+        }
+        else
+        {
+            out.push_back(types::Double::Empty());
+        }
+    }
+    else
+    {
+        out.push_back(types::Double::Empty());
+        out.push_back(types::Double::Empty());
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+static wchar_t* xls_basename(wchar_t* name)
+{
+       wchar_t* base = NULL;
+#ifdef _MSC_VER
+       base = wcsrchr (name, L'\\');
+#else
+       base = wcsrchr (name, L'/');
+#endif
+       return base ? base + 1 : name;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/spreadsheet/sci_gateway/cpp/sci_xls_read.cpp b/scilab/modules/spreadsheet/sci_gateway/cpp/sci_xls_read.cpp
new file mode 100644 (file)
index 0000000..38450a4
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2005-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+* Copyright (C) 2005-2008 - INRIA - Pierrick MODE
+* Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+* Copyright (C) 2011 - DIGITEO - Cedric DELAMARRE
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+#include "spreadsheet_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "xls.h"
+}
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_xls_read(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    // input
+    types::Double* pDblId       = NULL;
+    types::Double* pDblSheetpos = NULL;
+
+    int iId         = 0;
+    int iSheetpos   = 0;
+    int rows        = 0;
+    int cols        = 0;
+    int iErr        = 0;
+
+    int* ind     = NULL;
+    double* data = NULL;
+
+// *** check the minimal number of input args. ***
+    if(in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"xls_read", 2);
+        return types::Function::Error;
+    }
+
+// *** check number of output args according the methode. ***
+    if(_iRetCount != 2)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"xls_read", 2);
+        return types::Function::Error;
+    }
+
+// *** check type of input args and get it. ***
+    // file id
+    if(in[0]->isDouble() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"xls_read", 1);
+        return types::Function::Error;
+    }
+
+    pDblId = in[0]->getAs<types::Double>();
+
+    if(pDblId->isScalar() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"xls_read", 1);
+        return types::Function::Error;
+    }
+
+    iId = static_cast<int>(pDblId->get(0));
+
+    // sheetpos
+    if(in[1]->isDouble() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"xls_read", 2);
+        return types::Function::Error;
+    }
+
+    pDblSheetpos = in[1]->getAs<types::Double>();
+
+    if(pDblSheetpos->isScalar() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"xls_read", 2);
+        return types::Function::Error;
+    }
+
+    iSheetpos = static_cast<int>(pDblSheetpos->get(0));
+
+       xls_read(&iId, &iSheetpos, &data, &ind, &rows, &cols, &iErr);
+    switch(iErr)
+    {
+        case 1 :
+            ScierrorW(999,_W("%ls: No more memory.\n"), L"xls_read");
+            return types::Function::Error;
+        case 2 :
+            ScierrorW(999,_W("%ls: Failed to read expected data, may be invalid xls file.\n"), L"xls_read");
+            return types::Function::Error;
+        case 3 :
+            ScierrorW(999,_W("%ls: End of file.\n"), L"xls_read");
+            return types::Function::Error;
+        default :
+            /* no error */
+            break;
+    }
+
+    if(rows * cols)
+    {
+        types::Double* pDblData = new types::Double(rows, cols);
+        pDblData->set(data);
+        types::Double* pDblInd = new types::Double(rows, cols);
+
+        for(int i = 0; i < cols; i++)
+        {
+            for(int j = 0; j < rows; j++)
+            {
+                pDblInd->set(j, i, static_cast<int>(ind[i * rows + j]));
+            }
+        }
+
+        out.push_back(pDblData);
+        out.push_back(pDblInd);
+
+        free(data);
+        free(ind);
+    }
+    else
+    {
+        out.push_back(types::Double::Empty());
+        out.push_back(types::Double::Empty());
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
index 1d59d5b..c4ebc4c 100644 (file)
@@ -1,34 +1,24 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
+<!DOCTYPE module SYSTEM "../../functions/xml/gateway.dtd">
 <!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2011 - DIGITEO - Cedric DELAMARRE
  *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
- -->
-
-<!--
- Scilab Interface description. In this file, we define the list of the function which
+ */
+ Scilab
+ Interface description. In this file, we define the list of the function which
  will be available into Scilab and the link to the "native" function.
 
- gatewayId is the position in the hashtable 'Interfaces' defined in the
- file SCI/modules/core/src/c/callinterf.h
-
- primitiveId is the position in the hashtable '<module>Table Tab[]' defined
- in the file modules/<module>/sci_gateway/c/gw_<module>.c
-
- primitiveName is the name of the Scilab function
-
  Don't touch if you do not know what you are doing
 -->
-
-<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
-<GATEWAY name="spreadsheet">
-<PRIMITIVE gatewayId="56" primitiveId="1" primitiveName="xls_open" />
-<PRIMITIVE gatewayId="56" primitiveId="2" primitiveName="xls_read" />
-</GATEWAY>
+<module name="spreadsheet">
+    <gateway name="sci_xls_open"  function="xls_open"   type="1" />
+    <gateway name="sci_xls_read"  function="xls_read"   type="1" />
+</module>
index 4a99815..111a917 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;src/c/ripole;src/c;../core/includes;../fileio/includes;../io/includes;../string/includes;../output_stream/includes;../localization/includes;../../libs/MALLOC/includes;../../libs/intl;../api_scilab/includes;../operations/includes;../system_env/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c/ripole;src/c;../core/includes;../fileio/includes;../io/includes;../string/includes;../output_stream/includes;../localization/includes;../../libs/MALLOC/includes;../../libs/intl;../api_scilab/includes;../operations/includes;../system_env/includes;../types/includes;../dynamic_link/includes;../../libs/dynamiclibrary/includes;../ast/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;SPREADSHEET_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;src/c/ripole;src/c;../core/includes;../fileio/includes;../io/includes;../string/includes;../output_stream/includes;../localization/includes;../../libs/MALLOC/includes;../../libs/intl;../api_scilab/includes;../operations/includes;../system_env/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c/ripole;src/c;../core/includes;../fileio/includes;../io/includes;../string/includes;../output_stream/includes;../localization/includes;../../libs/MALLOC/includes;../../libs/intl;../api_scilab/includes;../operations/includes;../system_env/includes;../types/includes;../dynamic_link/includes;../../libs/dynamiclibrary/includes;../ast/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;SPREADSHEET_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>includes;src/c/ripole;src/c;../core/includes;../fileio/includes;../io/includes;../string/includes;../output_stream/includes;../localization/includes;../../libs/MALLOC/includes;../../libs/intl;../api_scilab/includes;../operations/includes;../system_env/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c/ripole;src/c;../core/includes;../fileio/includes;../io/includes;../string/includes;../output_stream/includes;../localization/includes;../../libs/MALLOC/includes;../../libs/intl;../api_scilab/includes;../operations/includes;../system_env/includes;../types/includes;../dynamic_link/includes;../../libs/dynamiclibrary/includes;../ast/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;SPREADSHEET_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>includes;src/c/ripole;src/c;../core/includes;../fileio/includes;../io/includes;../string/includes;../output_stream/includes;../localization/includes;../../libs/MALLOC/includes;../../libs/intl;../api_scilab/includes;../operations/includes;../system_env/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c/ripole;src/c;../core/includes;../fileio/includes;../io/includes;../string/includes;../output_stream/includes;../localization/includes;../../libs/MALLOC/includes;../../libs/intl;../api_scilab/includes;../operations/includes;../system_env/includes;../types/includes;../dynamic_link/includes;../../libs/dynamiclibrary/includes;../ast/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;SPREADSHEET_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="sci_gateway\cpp\sci_xls_open.cpp" />
+    <ClCompile Include="sci_gateway\cpp\sci_xls_read.cpp" />
     <ClCompile Include="src\c\ripole\bt-int.c" />
     <ClCompile Include="src\c\ripole\bytedecoders.c" />
     <ClCompile Include="src\c\DllmainSpreadsheet.c" />
     <ClCompile Include="src\c\ripole\olestream-unwrap.c" />
     <ClCompile Include="src\c\ripole\pldstr.c" />
     <ClCompile Include="src\c\ripole\ripole.c" />
-    <ClCompile Include="sci_gateway\c\sci_xls_open.c" />
-    <ClCompile Include="sci_gateway\c\sci_xls_read.c" />
     <ClCompile Include="src\c\xls.c" />
   </ItemGroup>
   <ItemGroup>
       <Project>{7ca60aef-9afa-4d06-af28-613c0aa27640}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\types\types.vcxproj">
+      <Project>{64e090da-dcb5-4f4d-93d7-e88ddec9c2ef}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\windows_tools\src\c\scilab_windows\scilab_windows.vcxproj">
       <Project>{8028f371-6a94-4a26-8804-6e7f05f1d1aa}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 2c06db5..48d70b3 100644 (file)
     <ClCompile Include="src\c\ripole\ripole.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sci_gateway\c\sci_xls_open.c">
+    <ClCompile Include="src\c\xls.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sci_gateway\c\sci_xls_read.c">
+    <ClCompile Include="sci_gateway\cpp\sci_xls_open.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="src\c\xls.c">
+    <ClCompile Include="sci_gateway\cpp\sci_xls_read.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
index 0763087..ca0f273 100644 (file)
@@ -168,7 +168,7 @@ int OLE_dir_init(struct OLE_directory_entry *dir )
        dir->right_child = 0;
        dir->root = 0;
 
-       dir->class[0] = '\0';
+       dir->_class[0] = '\0';
        dir->userflags = 0;
        dir->timestamps[0] = '\0';
        dir->start_sector = 0;
@@ -823,7 +823,7 @@ int OLE_convert_directory( struct OLE_object *ole, unsigned char *buf, struct OL
        **/
        dir->root = get_4byte_value( buf +0x4c );
 
-       memcpy( dir->class, buf +0x50, 16 );
+       memcpy( dir->_class, buf +0x50, 16 );
        dir->userflags = get_4byte_value( buf +0x60 );
        memcpy( dir->timestamps, buf +0x64, 16 ); /** Actually consists of 2 8 byte stamps **/
 
index 96d7184..f04b70c 100644 (file)
@@ -75,7 +75,7 @@ struct OLE_directory_entry {
        unsigned int right_child;
        unsigned int root;
 
-       unsigned char class[OLE_DIRECTORY_CLASS_SIZE];
+       unsigned char _class[OLE_DIRECTORY_CLASS_SIZE];
        unsigned int userflags;
        unsigned char timestamps[OLE_DIRECTORY_TIMESTAMPS_SIZE];
        unsigned int start_sector;
index bd7f094..d625129 100644 (file)
@@ -84,8 +84,7 @@ void xls_read(int *fd, int *cur_pos,double **data, int **chainesind, int *N, int
   *chainesind= (int *) NULL;
   *err=0;
 
-  *cur_pos=*cur_pos;
-  mseek(*fd, *cur_pos, SEEK_SET);
+  *err = mseek(*fd, *cur_pos, SEEK_SET);
   if (*err > 0) goto ErrL;
 
   /* first record should be a BOF */
@@ -101,13 +100,13 @@ void xls_read(int *fd, int *cur_pos,double **data, int **chainesind, int *N, int
     return;
   }
 
-  mtell(*fd);
+  pos = mtell(*fd);
   if (*err > 0) goto ErrL;
   *cur_pos=(int)pos;
 
   while(1)
     {
-      mseek(*fd, *cur_pos, SEEK_SET);
+      *err = mseek(*fd, *cur_pos, SEEK_SET);
       if (*err > 0) goto ErrL;
       /*Enregistrement de l'Opcode et de la Len du tag*/
       C2F(mgetnc) (fd, &Opcode, &one, typ_ushort, err);
@@ -189,7 +188,7 @@ void xls_read(int *fd, int *cur_pos,double **data, int **chainesind, int *N, int
        longueur=l_col;/*-f_col;*/
        capacite=hauteur*longueur;
 
-       /*D�claration des tableaux de synth�se*/
+       /*Declaration des tableaux de synthese*/
        if ((valeur=(void*) MALLOC((capacite+1)*sizeof(double)))==NULL)  goto ErrL;
        if ((*chainesind=(int *) MALLOC((capacite+1)*sizeof(int)))==NULL)  goto ErrL;
        for (i=0;i<=capacite;i++) {
@@ -261,7 +260,7 @@ void xls_open(int *err, int *fd, char ***sst, int *ns, char ***Sheetnames, int**
     4 = incorrect file
     5 = not a BIFF8 xls file
    */
-  /*---------------D�claration Des Variables*--------------------*/
+  /*---------------Declaration Des Variables*--------------------*/
   int k,one=1;
   int cur_pos, init_pos;
   double pos = 0;
@@ -270,14 +269,14 @@ void xls_open(int *err, int *fd, char ***sst, int *ns, char ***Sheetnames, int**
   int BOFData[7]; /*[BIFF  Version DataType Identifier Year HistoryFlags LowestXlsVersion]*/
   *nsheets=0;
   *err=0;
-  /*---------------D�claration Des Variables*--------------------*/
+  /*---------------Declaration Des Variables*--------------------*/
   cur_pos=0;
 
   /*  if (get_oleheader(fd)) {
     *err=1;
     return;
     }*/
-  mtell(*fd);
+  pos = mtell(*fd);
   cur_pos=(int)pos;
   init_pos=cur_pos;
 
@@ -294,7 +293,7 @@ void xls_open(int *err, int *fd, char ***sst, int *ns, char ***Sheetnames, int**
     return;
   }
 
-  mtell(*fd);
+  pos = mtell(*fd);
   if (*err > 0) goto Err2;
   cur_pos=(int)pos;
 
@@ -395,21 +394,21 @@ static void getBOF(int *fd ,int* Data, int *err)
     else
       BIFF=7;
     break;
-  case 1033 : /*Interpr�tation du BIFF4  0409 H*/
+  case 1033 : /*Interpretation du BIFF4  0409 H*/
     C2F(mgetnc) (fd, (void*)&Version, &one, typ_short, err);
     if (*err > 0) return;
     C2F(mgetnc) (fd, (void*)&DataType, &one, typ_short, err);
     if (*err > 0) return;
     BIFF=4;
     break;
-  case 521 : /*Interpr�tation du BIFF3  0209 H*/
+  case 521 : /*Interpretation du BIFF3  0209 H*/
     C2F(mgetnc) (fd, (void*)&Version, &one, typ_short, err);
     if (*err > 0) return;
     C2F(mgetnc) (fd, (void*)&DataType, &one, typ_short, err);
     if (*err > 0) return;
     BIFF=3;
     break;
-  case 9 : /*Interpr�tation du BIFF2  0009 H*/
+  case 9 : /*Interpretation du BIFF2  0009 H*/
     C2F(mgetnc) (fd, (void*)&Version, &one, typ_short, err);
     if (*err > 0) return;
     C2F(mgetnc) (fd, (void*)&DataType, &one, typ_short, err);
index 7bbee16..77bb81f 100644 (file)
@@ -1,27 +1,50 @@
+
 // =============================================================================
+
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+
 // Copyright (C) ????-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+
 //
+
 //  This file is distributed under the same license as the Scilab package.
+
 // =============================================================================
+
 ref1 = [ 0 1 2 3 4 5 6 7 8 9 ;
         10 11 12 13 14 15 16 17 18 19 ;
         20 21 22 23 24 25 26 27 28 29 ;
         30 31 32 33 34 35 36 37 38 39 ;
         40 41 42 43 44 45 46 47 48 49 ];
+
 ref2 = 'Test string 1';
+
 ref3 = 'Test string 2';
+
 ref4 = 'Test string 3';
+
 XLS = readxls(SCI+'/modules/spreadsheet/tests/unit_tests/readxls.xls');
+
 if type(XLS) <> 17 then bugmes();quit;end;
+
 if size(XLS(1)) <> [ 10 10 ] then bugmes();quit;end;
+
 if size(XLS(2)) <> 0 then bugmes();quit;end;
+
 if size(XLS(3)) <> 0 then bugmes();quit;end;
+
 Feuil1 = XLS(1);
+
 if size(Feuil1.value)<> [ 10 10 ] then bugmes();quit;end;
+
 if size(Feuil1.text)<> [ 10 10 ] then bugmes();quit;end;
 if Feuil1(1:5,1:10) <> ref1 then bugmes();quit;end;
+
 if Feuil1(8,1) <> ref2 then bugmes();quit;end;
+
 if Feuil1(9,2) <> ref3 then bugmes();quit;end;
+
 if Feuil1(10,3) <> ref4 then bugmes();quit;end;
+
 // =============================================================================
+
index 511ef44..47d5ae9 100644 (file)
@@ -1,9 +1,16 @@
+
 // =============================================================================
+
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+
 // Copyright (C) 2009 - DIGITEO
+
 //
+
 //  This file is distributed under the same license as the Scilab package.
+
 // =============================================================================
+
 tab_ref = [ ..
 "世界您好", ..
 "азеазея", ..
@@ -13,11 +20,15 @@ tab_ref = [ ..
 "프로그램", ..
 "프로그램", ..
 "תוכנית"];
+
 cd TMPDIR;
+
 mkdir open_xls_tests;
+
 cd open_xls_tests;
+
 origfile = SCI + "/modules/spreadsheet/tests/unit_tests/readxls.xls";
-       
+
 for i = 1 : size(tab_ref, "*")
        newfile = tab_ref(i) + ".xls";
        copyfile(origfile, newfile);
@@ -26,4 +37,6 @@ for i = 1 : size(tab_ref, "*")
        mclose(fileID);
 end
 cd TMPDIR;
+
 removedir open_xls_tests;
+
index 394c089..975b242 100644 (file)
@@ -25,11 +25,15 @@ namespace types
                                         MList() : TList() {}
                                         //Destructor uses ~TList()
 
+        virtual InternalType*           clone() {return new MList(this);}
         void                            whoAmI(void) { std::cout << "types::MList"; };
 
         RealType                        getType(void) { return RealMList; }
         bool                            isMList() { return true; }
         bool                            isTList() { return false; }
+
+    protected :
+                                        MList(MList *_oMListCopyMe) : TList(_oMListCopyMe) {}
     };
 }
 
index 1b0c3ed..9d3a038 100644 (file)
@@ -25,7 +25,7 @@ namespace types
     public :
                                         TList();
                                         ~TList();
-    private :
+    protected :
                                         TList(TList *_oTListCopyMe);
 
     public :
@@ -34,7 +34,7 @@ namespace types
         RealType                        getType(void) { return RealTList; }
         bool                            isTList() { return true; }
 
-        InternalType*                   clone();
+        virtual InternalType*           clone();
 
         bool                            exists(const std::wstring& _sKey);
         InternalType*                   get(const std::wstring& _sKey);