{
for (size_t i = 0; i < size ; ++i)
{
-#ifdef _MSC_VER
os_sprintf(o[i], length[i], "%s%s", l[i], r[i]);
-#else
- os_sprintf(o[i], "%s%s", l[i], r[i]);
-#endif
}
}
{
for (size_t i = 0; i < size ; ++i)
{
-#ifdef _MSC_VER
os_sprintf(o[i], length[i], "%s%s", l[i], r);
-#else
- os_sprintf(o[i], "%s%s", l[i], r);
-#endif
}
}
{
for (size_t i = 0; i < size ; ++i)
{
-#ifdef _MSC_VER
os_sprintf(o[i], length[i], "%s%s", l, r[i]);
-#else
- os_sprintf(o[i], "%s%s", l, r[i]);
-#endif
}
}
//string version
inline static void add(char* l, char* r, int length , char* o)
{
-#ifdef _MSC_VER
os_sprintf(o, length, "%s%s", l, r);
-#else
- os_sprintf(o, "%s%s", l, r);
-#endif
}
//x1C + x1C
if (m_iSize != 0 && iTmpSize / m_iSize != m_piDims[i])
{
char message[bsiz];
- os_sprintf(message, _("Can not allocate %.2f MB memory.\n"), (double) ((double) m_iSize * (double) m_piDims[i] * sizeof(T)) / 1.e6);
+ os_sprintf(message, bsiz, _("Can not allocate %.2f MB memory.\n"), (double) ((double) m_iSize * (double) m_piDims[i] * sizeof(T)) / 1.e6);
throw ast::InternalError(message);
}
m_pRealData = NULL;
m_pImgData = NULL;
char message[bsiz];
- os_sprintf(message, _("Can not allocate negative size (%d).\n"), m_iSize);
+ os_sprintf(message, bsiz, _("Can not allocate negative size (%d).\n"), m_iSize);
throw ast::InternalError(message);
}
catch (std::bad_alloc & /*e*/)
{
char message[bsiz];
- os_sprintf(message, _("Can not allocate %.2f MB memory.\n"), (double)(m_iSize * sizeof(T)) / 1.e6);
+ os_sprintf(message, bsiz, _("Can not allocate %.2f MB memory.\n"), (double)(m_iSize * sizeof(T)) / 1.e6);
throw ast::InternalError(message);
}
if (bPrintOne == true || _TVal != 1)
{
- os_sprintf(pstFormat, " %s%llu", pstSign, (unsigned long long)(_TVal));
- os_sprintf(pstOutput, "%*s", _iWidth + 1, pstFormat);//+1 for blank
+ os_sprintf(pstFormat, 32, " %s%llu", pstSign, (unsigned long long)(_TVal));
+ os_sprintf(pstOutput, 32, "%*s", _iWidth + 1, pstFormat);//+1 for blank
*_postr << pstOutput;
}
}
if (bPrintOne == true || _TVal != 1)
{
unsigned long long a = _abs64(_TVal);
- os_sprintf(pstFormat, " %s%llu", pstSign, a);
- os_sprintf(pstOutput, "%*s", _iWidth + 1, pstFormat);//+1 for blank
+ os_sprintf(pstFormat, 32, " %s%llu", pstSign, a);
+ os_sprintf(pstOutput, 32, "%*s", _iWidth + 1, pstFormat);//+1 for blank
*_postr << pstOutput;
}
}
{
char pstError[1024];
const char* pstFuncName = pVar->getSymbol().getName().data();
- os_sprintf(pstError, _("It is not possible to redefine the %s primitive this way (see clearfun).\n"), pstFuncName);
+ os_sprintf(pstError, 1024,_("It is not possible to redefine the %s primitive this way (see clearfun).\n"), pstFuncName);
pIT->killMe();
CoverageInstance::stopChrono((void*)&e);
throw InternalError(pstError, 999, e.getLocation());
if (pIT->isCallable())
{
const char* strFName = pIT->getAs<types::Callable>()->getName().c_str();
- os_sprintf(szError, _("%s: Wrong number of output argument(s): %d expected.\n"), strFName, out.size());
+ os_sprintf(szError, bsiz, _("%s: Wrong number of output argument(s): %d expected.\n"), strFName, out.size());
}
else
{
- os_sprintf(szError, _("%s: Wrong number of output argument(s): %d expected.\n"), "extract", out.size());
+ os_sprintf(szError, bsiz, _("%s: Wrong number of output argument(s): %d expected.\n"), "extract", out.size());
}
throw InternalError(szError, 999, e.getLocation());
#include "generic_operations.hxx"
#include "types_or.hxx"
#include "types_and.hxx"
-
+
#include "macrofile.hxx"
#include "macro.hxx"
#include "cell.hxx"
{
char pstError[bsiz];
const char* strErr = e.getSymbol().getName().c_str();
- os_sprintf(pstError, _("Undefined variable: %s\n"), strErr);
+ os_sprintf(pstError, bsiz, _("Undefined variable: %s\n"), strErr);
CoverageInstance::stopChrono((void*)&e);
throw InternalError(pstError, 999, e.getLocation());
if (!e.getTail()->isSimpleVar())
{
char szError[bsiz];
- os_sprintf(szError, _("/!\\ Unmanaged FieldExp.\n"));
+ os_sprintf(szError, bsiz, _("/!\\ Unmanaged FieldExp.\n"));
CoverageInstance::stopChrono((void*)&e);
throw InternalError(szError, 999, e.getLocation());
}
if (getResult() == NULL)
{
char szError[bsiz];
- os_sprintf(szError, _("Attempt to reference field of non-structure array.\n"));
+ os_sprintf(szError, bsiz, _("Attempt to reference field of non-structure array.\n"));
CoverageInstance::stopChrono((void*)&e);
throw InternalError(szError, 999, e.getLocation());
}
{
clearResult();
char szError[bsiz];
- os_sprintf(szError, _("Not yet implemented in Scilab.\n"));
+ os_sprintf(szError, bsiz, _("Not yet implemented in Scilab.\n"));
CoverageInstance::stopChrono((void*)&e);
throw InternalError(szError, 999, e.getLocation());
}
{
pValue->killMe();
char szError[bsiz];
- os_sprintf(szError, _("Attempt to reference field of non-structure array.\n"));
+ os_sprintf(szError, bsiz, _("Attempt to reference field of non-structure array.\n"));
CoverageInstance::stopChrono((void*)&e);
throw InternalError(szError, 999, e.getLocation());
}
{
clearResult();
char szError[bsiz];
- os_sprintf(szError, _("%s: Can not transpose multiple elements.\n"), "Transpose");
+ os_sprintf(szError, bsiz, _("%s: Can not transpose multiple elements.\n"), "Transpose");
CoverageInstance::stopChrono((void*)&e);
throw InternalError(szError, 999, e.getLocation());
}
{
char pstError[1024];
const char* pstFuncName = e.getSymbol().getName().c_str();
- os_sprintf(pstError, _("It is not possible to redefine the %s primitive this way (see clearfun).\n"), pstFuncName);
+ os_sprintf(pstError, 1024, _("It is not possible to redefine the %s primitive this way (see clearfun).\n"), pstFuncName);
pMacro->killMe();
CoverageInstance::stopChrono((void*)&e);
throw InternalError(pstError, 999, e.getLocation());
pITStart->killMe();
setResult(NULL);
char szError[bsiz];
- os_sprintf(szError, _("%s: Wrong type for argument %d: Real scalar expected.\n"), "':'", 1);
+ os_sprintf(szError, bsiz, _("%s: Wrong type for argument %d: Real scalar expected.\n"), "':'", 1);
CoverageInstance::stopChrono((void*)&e);
throw InternalError(szError, 999, e.getLocation());
}
pITStep->killMe();
setResult(NULL);
char szError[bsiz];
- os_sprintf(szError, _("%s: Wrong type for argument %d: Real scalar expected.\n"), "':'", 2);
+ os_sprintf(szError, bsiz, _("%s: Wrong type for argument %d: Real scalar expected.\n"), "':'", 2);
CoverageInstance::stopChrono((void*)&e);
throw InternalError(szError, 999, e.getLocation());
}
pITEnd->killMe();
setResult(NULL);
char szError[bsiz];
- os_sprintf(szError, _("%s: Wrong type for argument %d: Real scalar expected.\n"), "':'", 3);
+ os_sprintf(szError, bsiz, _("%s: Wrong type for argument %d: Real scalar expected.\n"), "':'", 3);
CoverageInstance::stopChrono((void*)&e);
throw InternalError(szError, 999, e.getLocation());
}
//print msg about recursion limit and trigger an error
char sz[1024];
- os_sprintf(sz, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
+ os_sprintf(sz, 1024, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
CoverageInstance::stopChrono((void*)&e);
throw ast::InternalError(sz);
}
{
char szError[bsiz];
const char* strFName = pITCurrent->getAs<types::Callable>()->getName().c_str();
- os_sprintf(szError, _("Wrong insertion: insertion in output of '%s' is not allowed.\n"), strFName);
+ os_sprintf(szError, bsiz, _("Wrong insertion: insertion in output of '%s' is not allowed.\n"), strFName);
throw ast::InternalError(szError, 999, pEH->getExp()->getLocation());
}
}
char pMsg[bsiz];
- os_sprintf(pMsg, _("Error: operator %s: Matrix dimensions must agree (op1 is %s, op2 is %s).\n"), "+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
+ os_sprintf(pMsg, bsiz, _("Error: operator %s: Matrix dimensions must agree (op1 is %s, op2 is %s).\n"), "+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
throw ast::InternalError(pMsg);
}
}
if (piDims1[i] != piDims2[i])
{
char pMsg[bsiz];
- os_sprintf(pMsg, _("Error: operator %s: Matrix dimensions must agree (op1 is %s, op2 is %s).\n"), "+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
+ os_sprintf(pMsg, bsiz, _("Error: operator %s: Matrix dimensions must agree (op1 is %s, op2 is %s).\n"), "+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
throw ast::InternalError(pMsg);
}
}
if (piDims1[i] != piDims2[i])
{
char pMsg[bsiz];
- os_sprintf(pMsg, _("Error: operator %s: Matrix dimensions must agree (op1 is %s, op2 is %s).\n"), "-", _pL->DimToString().c_str(), _pR->DimToString().c_str());
+ os_sprintf(pMsg, bsiz, _("Error: operator %s: Matrix dimensions must agree (op1 is %s, op2 is %s).\n"), "-", _pL->DimToString().c_str(), _pR->DimToString().c_str());
throw ast::InternalError(pMsg);
}
}
if (piDims1[i] != piDims2[i])
{
char pMsg[bsiz];
- os_sprintf(pMsg, _("Error: operator %s: Matrix dimensions must agree (op1 is %s, op2 is %s).\n"), "+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
+ os_sprintf(pMsg, bsiz, _("Error: operator %s: Matrix dimensions must agree (op1 is %s, op2 is %s).\n"), "+", _pL->DimToString().c_str(), _pR->DimToString().c_str());
throw ast::InternalError(pMsg);
}
}
if (!yyin)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: Cannot open file %s.\n"), "parser", fileName.c_str());
+ os_sprintf(szError, bsiz, _("%s: Cannot open file %s.\n"), "parser", fileName.c_str());
throw ast::InternalError(szError);
}
#ifdef _MSC_VER
char szFile[MAX_PATH];
char* pstTmpDIr = getTMPDIR();
- os_sprintf(szFile, "%s\\%s", pstTmpDIr, "command.temp");
+ os_sprintf(szFile, MAX_PATH, "%s\\%s", pstTmpDIr, "command.temp");
FREE(pstTmpDIr);
if (fileLocker)
{
ParserSingleInstance::setExitStatus(Parser::Failed);
ParserSingleInstance::resetErrorMessage();
char szError[bsiz];
- os_sprintf(szError, _("%s: Cannot open file %s.\n"), "parser", szFile);
+ os_sprintf(szError, bsiz, _("%s: Cannot open file %s.\n"), "parser", szFile);
appendErrorMessage(szError);
return;
}
{
if (console)
{
- for (const auto& var : *console)
+ for (const auto & var : *console)
{
lst.push_back(var.first.getName());
}
iCurrentWidth += iVarLenMax + 1;
}
- os_sprintf(varElem, _(" using %10d elements out of %10d.\n"), iMemUsed, iMemTotal);
+ os_sprintf(varElem, strSize, _(" using %10d elements out of %10d.\n"), iMemUsed, iMemTotal);
ostr << std::endl << varElem;
- os_sprintf(varVariable, _(" and %10d variables out of %10d.\n"), lstVar.size(), nbMaxVar);
+ os_sprintf(varVariable, strSize, _(" and %10d variables out of %10d.\n"), lstVar.size(), nbMaxVar);
ostr << varVariable << std::endl;
ostr << std::endl << _("Your global variables are:") << std::endl << std::endl;
ostr << std::endl;
- os_sprintf(globalElem, _(" using %10d elements out of %10d.\n"), iMemUsed, iMemTotal);
+ os_sprintf(globalElem, strSize, _(" using %10d elements out of %10d.\n"), iMemUsed, iMemTotal);
ostr << std::endl << globalElem;
- os_sprintf(globalVariable, _(" and %10d variables out of %10d.\n"), lstGlobal.size(), nbMaxVar);
+ os_sprintf(globalVariable, strSize, _(" and %10d variables out of %10d.\n"), lstGlobal.size(), nbMaxVar);
ostr << globalVariable;
}
if (where.m_name == "execstr")
{
isExecstr = true;
- os_sprintf(csTmp, strExecStr.c_str(), where.m_line);
+ os_sprintf(csTmp, bsiz, strExecStr.c_str(), where.m_line);
ostr << csTmp << std::endl;
continue;
}
else if (where.m_name == "exec")
{
- os_sprintf(csTmp, strExecFile.c_str(), where.m_line);
+ os_sprintf(csTmp, bsiz, strExecFile.c_str(), where.m_line);
ostr << csTmp << where.m_file_name << std::endl;
continue;
}
else
{
- os_sprintf(csTmp, strAtLine.c_str(), where.m_line);
+ os_sprintf(csTmp, bsiz, strAtLine.c_str(), where.m_line);
ostr << csTmp;
}
}
}
/* Set SCIHOME environment variable */
- os_sprintf(USERPATHSCILAB, "%s%s%s", USERHOMESYSTEM, DIR_SEPARATOR, BASEDIR);
- os_sprintf(SCIHOMEPATH, "%s%s%s", USERPATHSCILAB, DIR_SEPARATOR, SCI_VERSION_STRING);
+ os_sprintf(USERPATHSCILAB, PATH_MAX, "%s%s%s", USERHOMESYSTEM, DIR_SEPARATOR, BASEDIR);
+ os_sprintf(SCIHOMEPATH, PATH_MAX * 2, "%s%s%s", USERPATHSCILAB, DIR_SEPARATOR, SCI_VERSION_STRING);
/* creates directory if it does not exists */
if (!isdir(SCIHOMEPATH))
char tmp_dir[PATH_MAX + FILENAME_MAX + 1];
static char bufenv[PATH_MAX + 16];
char *TmpDir = NULL;
- os_sprintf(tmp_dir, "%sSCI_TMP_%d_", tmpDirDefault, _getpid());
+ os_sprintf(tmp_dir, PATH_MAX + FILENAME_MAX + 1, "%sSCI_TMP_%d_", tmpDirDefault, _getpid());
if (CreateDirectoryA(tmp_dir, NULL) == FALSE)
{
DWORD attribs = GetFileAttributesA(tmp_dir);
#ifdef _DEBUG
{
char MsgErr[1024];
- os_sprintf(MsgErr, _("Impossible to create : %s"), tmp_dir);
+ os_sprintf(MsgErr, 1024, _("Impossible to create : %s"), tmp_dir);
MessageBoxA(NULL, MsgErr, _("Error"), MB_ICONERROR);
exit(1);
}
}
}
- os_sprintf(bufenv, "TMPDIR=%s", tmp_dir);
+ os_sprintf(bufenv, PATH_MAX + 16, "TMPDIR=%s", tmp_dir);
_putenv(bufenv);
return os_strdup(tmp_dir);
/* Build the full path to the library */
int iPathToLibLen = (strlen(pstScilabPath) + strlen(pstModulesPath) + strlen(m_stModule.c_str()) + strlen("/") + strlen(pstLTDir) + strlen(m_libName.c_str()) + 1);
char* pstPathToLib = (char*)MALLOC(iPathToLibLen * sizeof(char));
-#ifdef _MSC_VER
os_sprintf(pstPathToLib, iPathToLibLen, "%s%s%s/%s%s", pstScilabPath, pstModulesPath, m_stModule.c_str(), pstLTDir, m_libName.c_str());
-#else
- os_sprintf(pstPathToLib, "%s%s%s/%s%s", pstScilabPath, pstModulesPath, m_stModule.c_str(), pstLTDir, m_libName.c_str());
-#endif
FREE(pstScilabPath);
hLib = LoadDynLibrary(pstPathToLib);
bool Library::toString(std::ostringstream& ostr)
{
char output[1024] = {0};
- os_sprintf(output, _("Functions files location : %s.\n"), m_path.c_str());
+ os_sprintf(output, 1024, _("Functions files location : %s.\n"), m_path.c_str());
ostr << output << std::endl;
if (out == NULL)
{
char szError[bsiz];
- os_sprintf(szError, _("Unknown field : %s.\n"), name.c_str());
+ os_sprintf(szError, bsiz, _("Unknown field : %s.\n"), name.c_str());
throw std::string(szError);
}
char pstError2[512];
if (_isOperator)
{
- os_sprintf(pstError2, _("check or define function %s for overloading.\n"), _stOverloadingFunctionName.c_str());
- os_sprintf(pstError1, "%s%s", _("Undefined operation for the given operands.\n"), pstError2);
+ os_sprintf(pstError2, 512, _("check or define function %s for overloading.\n"), _stOverloadingFunctionName.c_str());
+ os_sprintf(pstError1, 512, "%s%s", _("Undefined operation for the given operands.\n"), pstError2);
}
else
{
- os_sprintf(pstError2, _(" check arguments or define function %s for overloading.\n"), _stOverloadingFunctionName.c_str());
- os_sprintf(pstError1, "%s%s", _("Function not defined for given argument type(s),\n"), pstError2);
+ os_sprintf(pstError2, 512, _(" check arguments or define function %s for overloading.\n"), _stOverloadingFunctionName.c_str());
+ os_sprintf(pstError1, 512, "%s%s", _("Function not defined for given argument type(s),\n"), pstError2);
}
ast::InternalError ie(pstError1);
{
switch (_oper)
{
- /* standard operators */
+ /* standard operators */
case ast::OpExp::plus :
return "a";
case ast::OpExp::unaryMinus :
return "l";
case ast::OpExp::power :
return "p";
- /* dot operators */
+ /* dot operators */
case ast::OpExp::dottimes :
return "x";
case ast::OpExp::dotrdivide :
return "q";
case ast::OpExp::dotpower :
return "j";
- /* Kron operators */
+ /* Kron operators */
case ast::OpExp::krontimes :
return "k";
case ast::OpExp::kronrdivide :
return "y";
case ast::OpExp::kronldivide :
return "z";
- /* Control Operators ??? */
+ /* Control Operators ??? */
case ast::OpExp::controltimes :
return "u";
case ast::OpExp::controlrdivide :
if (p->getVariableName() != getVariableName())
{
char szError[512];
- os_sprintf(szError, _("Input arguments should have the same formal variable name.\n"));
+ os_sprintf(szError, 512, _("Input arguments should have the same formal variable name.\n"));
throw ast::InternalError(szError);
}
m_pRealData = NULL;
m_pImgData = NULL;
char message[bsiz];
- os_sprintf(message, _("Can not allocate negative size (%d).\n"), _iSize);
+ os_sprintf(message, bsiz, _("Can not allocate negative size (%d).\n"), _iSize);
throw ast::InternalError(message);
}
else
catch (std::bad_alloc &/*e*/)
{
char message[bsiz];
- os_sprintf(message, _("Can not allocate %.2f MB memory.\n"), (double) (_iSize * sizeof(double)) / 1.e6);
+ os_sprintf(message, bsiz, _("Can not allocate %.2f MB memory.\n"), (double) (_iSize * sizeof(double)) / 1.e6);
throw ast::InternalError(message);
}
catch (std::bad_alloc & /*e*/)
{
char message[bsiz];
- os_sprintf(message, _("Can not allocate data.\n"));
+ os_sprintf(message, bsiz, _("Can not allocate data.\n"));
throw ast::InternalError(message);
}
catch (std::bad_alloc & /*e*/)
{
char message[bsiz];
- os_sprintf(message, _("Can not allocate %.2f MB memory.\n"), (double)(_iSize * sizeof(char*)) / 1.e6);
+ os_sprintf(message, bsiz, _("Can not allocate %.2f MB memory.\n"), (double)(_iSize * sizeof(char*)) / 1.e6);
throw ast::InternalError(message);
}
return pStr;
else
{
char szError[bsiz];
- os_sprintf(szError, _("Unknown field : %s.\n"), name.c_str());
+ os_sprintf(szError, bsiz, _("Unknown field : %s.\n"), name.c_str());
throw std::string(szError);
}
else
{
char szError[bsiz];
- os_sprintf(szError, _("Field \"%s\" does not exists\n"), stField.c_str());
+ os_sprintf(szError, bsiz, _("Field \"%s\" does not exists\n"), stField.c_str());
throw ast::InternalError(szError, 999, e.getLocation());
}
}
}
}
- os_sprintf(pstSign, "%s%s%s", pBlank, pSign, pBlank);
+ os_sprintf(pstSign, 32, "%s%s%s", pBlank, pSign, pBlank);
if (ISNAN(_dblVal))
{
//NaN
- os_sprintf(pstOutput, "%s%*s", pstSign, _pDF->iPrec, "Nan");
+ os_sprintf(pstOutput, 32, "%s%*s", pstSign, _pDF->iPrec, "Nan");
}
else if (!finite(_dblVal))
{
//Inf
- os_sprintf(pstOutput, "%s%*s", pstSign, _pDF->iPrec, "Inf");
+ os_sprintf(pstOutput, 32, "%s%*s", pstSign, _pDF->iPrec, "Inf");
}
else if (_pDF->bExp)
{
if (_pDF->bPrintPoint)
{
- os_sprintf(pstFormat, "%s%%#d.%%0%ddD%%+.02d", pstSign, _pDF->iPrec);
+ os_sprintf(pstFormat, 32, "%s%%#d.%%0%ddD%%+.02d", pstSign, _pDF->iPrec);
}
else
{
- os_sprintf(pstFormat, "%s%%d%%0%ddD%%+.02d", pstSign, _pDF->iPrec);
+ os_sprintf(pstFormat, 32, "%s%%d%%0%ddD%%+.02d", pstSign, _pDF->iPrec);
}
if ((int)std::round(dblDec) != (int)dblDec)
dblDec = d1;
}
- os_sprintf(pstOutput, pstFormat, (int)dblEnt, (int)dblDec, (int)dblTemp);
+ os_sprintf(pstOutput, 32, pstFormat, (int)dblEnt, (int)dblDec, (int)dblTemp);
}
else if ((_pDF->bPrintOne == true) || (isEqual(fabs(_dblVal), 1)) == false)
{
//do not print if _bPrintOne == false && _dblVal == 1
if (_pDF->bPrintPoint)
{
- os_sprintf(pstFormat, "%s%%#-%d.%df", pstSign, _pDF->iWidth - 1, _pDF->iPrec);
+ os_sprintf(pstFormat, 32, "%s%%#-%d.%df", pstSign, _pDF->iWidth - 1, _pDF->iPrec);
}
else
{
- os_sprintf(pstFormat, "%s%%-%d.%df", pstSign, _pDF->iWidth - 2, _pDF->iPrec); //-2 no point needed
+ os_sprintf(pstFormat, 32, "%s%%-%d.%df", pstSign, _pDF->iWidth - 2, _pDF->iPrec); //-2 no point needed
}
- os_sprintf(pstOutput, pstFormat, fabs(_dblVal));
+ os_sprintf(pstOutput, 32, pstFormat, fabs(_dblVal));
}
else if (strlen(pstSign) != 0)
{
- os_sprintf(pstOutput, "%s", pstSign);
+ os_sprintf(pstOutput, 32, "%s", pstSign);
}
*_postr << pstOutput;
{
switch (val->getType())
{
- //scalar
+ //scalar
case InternalType::ScilabDouble:
{
return getIndex(val->getAs<Double>());
if (pCurrentArg->get(j) >= INT_MAX)
{
char szError[bsiz];
- os_sprintf(szError, _("variable size exceeded : less than %d expected.\n"), INT_MAX);
+ os_sprintf(szError, bsiz, _("variable size exceeded : less than %d expected.\n"), INT_MAX);
throw ast::InternalError(szError);
}
else
{
char szError[bsiz];
- os_sprintf(szError, _("Invalid index.\n"));
+ os_sprintf(szError, bsiz, _("Invalid index.\n"));
delete[] _piMaxDim;
delete[] _piCountDim;
movingPointerOnFindCopy[0] = '\0';
//Check if the cutted tmpfind match with the suffix of string that has adequat length
pointerOnString = (char*)(string + stringLength - 1 - strlen(pointerOnFindCopy));
- if ( !strnicmp(pointerOnFindCopy, pointerOnString, strlen(pointerOnFindCopy)) )
+ if ( !os_strnicmp(pointerOnFindCopy, pointerOnString, strlen(pointerOnFindCopy)) )
{
FREE(pointerOnFindCopy);
pointerOnFindCopy = NULL;
{
if (dictionary[i])
{
- if ( strnicmp(dictionary[i], somechars, strlen(somechars)) == 0)
+ if ( os_strnicmp(dictionary[i], somechars, strlen(somechars)) == 0)
{
nbElements++;
/* +1 in MALLOC because a NULL element is inserted at the end of the array */
if (FileExtension)
{
- if ( (stricmp(FileExtension, BIN_EXTENSION_FILE) == 0) ||
- (stricmp(FileExtension, SAV_EXTENSION_FILE) == 0) ||
- (stricmp(FileExtension, SOD_EXTENSION_FILE) == 0))
+ if ( (os_stricmp(FileExtension, BIN_EXTENSION_FILE) == 0) ||
+ (os_stricmp(FileExtension, SAV_EXTENSION_FILE) == 0) ||
+ (os_stricmp(FileExtension, SOD_EXTENSION_FILE) == 0))
{
command = buildCommand(FORMAT_BIN_SCE_EXTENSION_FILES, File);
}
- else if ( (stricmp(FileExtension, COS_EXTENSION_FILE) == 0) ||
- (stricmp(FileExtension, COSF_EXTENSION_FILE) == 0) ||
- (stricmp(FileExtension, ZCOS_EXTENSION_FILE) == 0) ||
- (stricmp(FileExtension, XCOS_EXTENSION_FILE) == 0))
+ else if ( (os_stricmp(FileExtension, COS_EXTENSION_FILE) == 0) ||
+ (os_stricmp(FileExtension, COSF_EXTENSION_FILE) == 0) ||
+ (os_stricmp(FileExtension, ZCOS_EXTENSION_FILE) == 0) ||
+ (os_stricmp(FileExtension, XCOS_EXTENSION_FILE) == 0))
{
if (with_module("xcos"))
{
command = os_strdup(XCOS_NOT_INSTALLED);
}
}
- else if (stricmp(FileExtension, SCI_EXTENSION_FILE) == 0)
+ else if (os_stricmp(FileExtension, SCI_EXTENSION_FILE) == 0)
{
command = buildCommand(FORMAT_SCI_EXTENSION_FILES, File);
}
- else if ( (stricmp(FileExtension, SCE_EXTENSION_FILE) == 0) || (stricmp(FileExtension, TST_EXTENSION_FILE) == 0) || (stricmp(FileExtension, DEM_EXTENSION_FILE) == 0) )
+ else if ( (os_stricmp(FileExtension, SCE_EXTENSION_FILE) == 0) || (os_stricmp(FileExtension, TST_EXTENSION_FILE) == 0) || (os_stricmp(FileExtension, DEM_EXTENSION_FILE) == 0) )
{
command = buildCommand(FORMAT_SCE_TST_EXTENSION_FILES, File);
}
- else if (stricmp(FileExtension, SCG_EXTENSION_FILE) == 0)
+ else if (os_stricmp(FileExtension, SCG_EXTENSION_FILE) == 0)
{
command = buildCommand(FORMAT_SCG_EXTENSION_FILES, File);
}
}
types::String* pMode = in[1]->getAs<types::String>();
- if (stricmp(pMode->get(0), "add") == 0)
+ if (os_stricmp(pMode->get(0), "add") == 0)
{
bAdd = true;
}
- else if (stricmp(pMode->get(0), "remove") == 0)
+ else if (os_stricmp(pMode->get(0), "remove") == 0)
{
bAdd = false;
}
// Set history
if (prefs->historyEnable)
{
- if (!stricmp(prefs->historyEnable, "true"))
+ if (!os_stricmp(prefs->historyEnable, "true"))
{
if (prefs->historyFile && prefs->historyLines)
{
// Set lines
if (prefs->adaptToDisplay && prefs->columnsToDisplay && prefs->linesToDisplay)
{
- if (stricmp(prefs->adaptToDisplay, "true"))
+ if (os_stricmp(prefs->adaptToDisplay, "true"))
{
// it is not true so ...
int lines = (int)atof(prefs->linesToDisplay);
// Set current directory
if (!useCWD && prefs->startup_dir_use)
{
- if (stricmp(prefs->startup_dir_use, "current"))
+ if (os_stricmp(prefs->startup_dir_use, "current"))
{
// Not in cwd
- if (stricmp(prefs->startup_dir_use, "previous") == 0 && prefs->startup_dir_previous && *prefs->startup_dir_previous)
+ if (os_stricmp(prefs->startup_dir_use, "previous") == 0 && prefs->startup_dir_previous && *prefs->startup_dir_previous)
{
scichdir((char*)prefs->startup_dir_previous);
}
- else if (stricmp(prefs->startup_dir_use, "default") == 0 && prefs->startup_dir_default && *prefs->startup_dir_default)
+ else if (os_stricmp(prefs->startup_dir_use, "default") == 0 && prefs->startup_dir_default && *prefs->startup_dir_default)
{
scichdir((char*)prefs->startup_dir_default);
}
/* Don't care about line return / empty line */
xmlKeepBlanksDefault(0);
/* check if the XML file has been encoded with utf8 (unicode) or not */
- if (stricmp("utf-8", encoding) == 0)
+ if (os_stricmp("utf-8", encoding) == 0)
{
xmlDocPtr doc = NULL;
xmlXPathContextPtr xpathCtxt = NULL;
{
/* we found the tag activate */
const char *str = (const char*)attrib->children->content;
- if (stricmp(str, "yes") == 0 || strcmp(str, "1") == 0)
+ if (os_stricmp(str, "yes") == 0 || strcmp(str, "1") == 0)
{
activate = 1;
}
#include "getshortpathname.h"
#include "charEncoding.h"
#include "version.h"
+#include "os_string.h"
/*--------------------------------------------------------------------------*/
BOOL getversionmodule(const char* _pstModule,
int *sci_version_major,
xmlKeepBlanksDefault(0);
/* check if the XML file has been encoded with utf8 (unicode) or not */
- if (stricmp("utf-8", encoding) == 0)
+ if (os_stricmp("utf-8", encoding) == 0)
{
xmlDocPtr doc = NULL;
xmlXPathContextPtr xpathCtxt = NULL;
if (values)
{
- if (values[0] && stricmp(values[0], "previous") == 0)
+ if (values[0] && os_stricmp(values[0], "previous") == 0)
{
int err;
char * cwd = scigetcwd(&err);
}
else if (commandsize > 1 && command[0] == 'p' && command[1] == ' ')
{
- std::string s("disp(");
- s += command + 2;
- s += ")";
- tmpCommand = os_strdup(s.data());
- disableDebug = true;
+ std::string s("disp(");
+ s += command + 2;
+ s += ")";
+ tmpCommand = os_strdup(s.data());
+ disableDebug = true;
}
else if (commandsize > 6 && strncmp(command, "print ", 6) == 0)
{
{
int iLen = (int)strlen(command) + (int)strlen("debug ") + 1;
tmpCommand = (char*)MALLOC(sizeof(char) * iLen);
-#ifdef _MSC_VER
os_sprintf(tmpCommand, iLen, "%s %s", "debug", command);
-#else
- os_sprintf(tmpCommand, "%s %s", "debug", command);
-#endif
disableDebug = true;
}
//print msg about recursion limit and trigger an error
char sz[1024];
- os_sprintf(sz, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
+ os_sprintf(sz, 1024, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
throw ast::InternalError(sz);
}
}
}
}
}
- FREE(libFile);
}
void CoverModule::getBuiltins(const std::vector<std::pair<std::string, std::string>> & paths_mods)
return false;
}
- if (!doc->encoding || stricmp((const char *)doc->encoding, "utf-8") != 0)
+ if (!doc->encoding || os_stricmp((const char *)doc->encoding, "utf-8") != 0)
{
xmlFreeDoc(doc);
return false;
DifferentialEquation::removeDifferentialEquationFunctions();
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "bvode", "bvode");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "bvode", "bvode");
os << szError;
throw ast::InternalError(os.str());
}
if (bOK == false)
{
- const char* pst = pStr->get(0);
+ char* pst = pStr->get(0);
Scierror(50, _("%s: Subroutine not found: %s\n"), "daskr", pst);
FREE(pst);
DifferentialEquation::removeDifferentialEquationFunctions();
LENWP = pDblX0->getRows() * pDblX0->getRows();
rworksize += (maxord + 5) * pDblX0->getRows() + 3 * ng
- + (maxl + 3 + std::min(1, maxl - kmp)) * pDblX0->getRows()
- + (maxl + 3) * maxl + 1 + LENWP;
+ + (maxl + 3 + std::min(1, maxl - kmp)) * pDblX0->getRows()
+ + (maxl + 3) * maxl + 1 + LENWP;
}
if (info[15] == 1)
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "daskr", "ddaskr");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "daskr", "ddaskr");
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "dasrt", "ddasrt");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "dasrt", "ddasrt");
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "dassl", "dassl");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "dassl", "dassl");
os << szError;
throw ast::InternalError(os.str());
}
delete pDblOut;
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "feval", "execFevalF");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "feval", "execFevalF");
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "impl", "lsodi");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "impl", "lsodi");
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "int2d", "twodq");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "int2d", "twodq");
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "int3d", "dcutet");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "int3d", "dcutet");
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "intg", "dqags");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "intg", "dqags");
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "ode", strMeth.c_str());
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "ode", strMeth.c_str());
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "ode", strMeth.c_str());
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "ode", strMeth.c_str());
os << szError;
throw ast::InternalError(os.str());
}
}
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "odedc", "tright");
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "odedc", "tright");
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "odedc", strMeth.c_str());
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "odedc", strMeth.c_str());
os << szError;
throw ast::InternalError(os.str());
}
if (bCatch)
{
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "odedc", strMeth.c_str());
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "odedc", strMeth.c_str());
os << szError;
throw ast::InternalError(os.str());
}
}
char szError[bsiz];
- os_sprintf(szError, _("%s: An error occured in '%s' subroutine.\n"), "odedc", tright);
+ os_sprintf(szError, bsiz, _("%s: An error occured in '%s' subroutine.\n"), "odedc", tright);
os << szError;
throw ast::InternalError(os.str());
}
}
#else
{
- char* pstDynLibPath = wide_string_to_UTF8(_pstDynLibPath);
- hLib = LoadDynLibrary (pstDynLibPath);
- FREE(pstDynLibPath);
+ hLib = LoadDynLibrary (_pstDynLibPath);
}
#endif
#include "freeArrayOfString.h"
#include "charEncoding.h"
#include "expandPathVariable.h"
+#include "os_string.h"
/*--------------------------------------------------------------------------*/
static char *getFilenameWithExtension(char* fullFilename);
static int returnCopyFileResultOnStack(int ierr, char *fname , void* pvApiCtx);
Scierror(999, _("%s: Memory allocation error.\n"), fname);
return 0;
}
-
+
strcpy(sciError, "");
}
#else
#include "freeArrayOfString.h"
#include "charEncoding.h"
#include "expandPathVariable.h"
+#include "os_string.h"
/*--------------------------------------------------------------------------*/
static char* getFilenameWithExtensionForMove(char* fullFilename);
static int returnMoveFileResultOnStack(int ierr, char *fname, void* pvApiCtx);
Scierror(999, _("%s: Memory allocation error.\n"), fname);
return 0;
}
-
+
strcpy(sciError, "");
}
#else
}
iRet = mclose(iFileID);
}
- else if (stricmp(pS->get(0), "all") == 0)
+ else if (os_stricmp(pS->get(0), "all") == 0)
{
iRet = mcloseAll();
}
/*--------------------------------------------------------------------------*/
types::Function::ReturnValue sci_mget(types::typed_list &in, int _iRetCount, types::typed_list &out)
{
- char* pstType = "l";//default type value : long
+ const char* pstType = "l";//default type value : long
int iSize = 0;
int iFile = -1; //default file : last opened file
int iErr = 0;
{
case 0: // stderr
case 6: // stdout
- FREE(pstType);
Scierror(999, _("%s: Wrong file descriptor: %d.\n"), "mget", iFile);
return types::Function::Error;
}
// file opened with fortran open function
if (pFile == NULL || pFile->getFileType() == 1)
{
- FREE(pstType);
Scierror(999, _("%s: Wrong file descriptor: %d.\n"), "mget", iFile);
return types::Function::Error;
}
int iErr = 0;
int iID = 0;
char* pstFilename = NULL;
- char* pstMode = "rb";
+ const char* pstMode = "rb";
int iSwap = 0;
//check output parameters
/*--------------------------------------------------------------------------*/
types::Function::ReturnValue sci_mput(types::typed_list &in, int _iRetCount, types::typed_list &out)
{
- char* pstType = "l";//default type value : long
+ char* pstType = (char*)"l";//default type value : long
int iSize = 0;
int iFile = -1; //default file : last opened file
double* pData = NULL;
#include "fullpath.h"
#include "os_string.h"
/*--------------------------------------------------------------------------*/
-static int CopyFileFunction_others(wchar_t *DestinationFilename, wchar_t *SourceFilename);
-static int CopyDirectoryFunction_others(wchar_t *DestinationDirectory, wchar_t *SourceDirectory);
+static int CopyFileFunction_others(char* DestinationFilename, char* SourceFilename);
+static int CopyDirectoryFunction_others(char* DestinationDirectory, char* SourceDirectory);
static int RecursiveCopyDirectory(char *DestinationDir, char *SourceDir);
/*--------------------------------------------------------------------------*/
-int CopyFileFunction(wchar_t *DestinationFilename, wchar_t *SourceFilename)
+int CopyFileFunction(char* DestinationFilename, char* SourceFilename)
{
- if (os_wcsicmp(DestinationFilename, SourceFilename) == 0)
+ if (os_stricmp(DestinationFilename, SourceFilename) == 0)
{
return EPERM;
}
return CopyFileFunction_others(DestinationFilename, SourceFilename);
}
/*--------------------------------------------------------------------------*/
-int CopyDirectoryFunction(wchar_t *DestinationDirectory, wchar_t *SourceDirectory)
+int CopyDirectoryFunction(char* DestinationDirectory, char* SourceDirectory)
{
/* remove last file separator if it does not exists */
- if ( (SourceDirectory[wcslen(SourceDirectory) - 1] == L'\\') ||
- (SourceDirectory[wcslen(SourceDirectory) - 1] == L'/') )
+ if ( (SourceDirectory[strlen(SourceDirectory) - 1] == '\\') ||
+ (SourceDirectory[strlen(SourceDirectory) - 1] == '/') )
{
- SourceDirectory[wcslen(SourceDirectory) - 1] = L'\0';
+ SourceDirectory[strlen(SourceDirectory) - 1] = '\0';
}
/* remove last file separator if it does not exists */
- if ( (DestinationDirectory[wcslen(DestinationDirectory) - 1] == L'\\') ||
- (DestinationDirectory[wcslen(DestinationDirectory) - 1] == L'/') )
+ if ( (DestinationDirectory[strlen(DestinationDirectory) - 1] == '\\') ||
+ (DestinationDirectory[strlen(DestinationDirectory) - 1] == '/') )
{
- DestinationDirectory[wcslen(DestinationDirectory) - 1] = L'\0';
+ DestinationDirectory[strlen(DestinationDirectory) - 1] = '\0';
}
return CopyDirectoryFunction_others(DestinationDirectory, SourceDirectory);
}
/*--------------------------------------------------------------------------*/
/* Copy file with all attributes */
-static int CopyFileFunction_others(wchar_t *DestinationFilename, wchar_t *SourceFilename)
+static int CopyFileFunction_others(char* DestinationFilename, char* SourceFilename)
{
- char *pStrDest = wide_string_to_UTF8(DestinationFilename);
- char *pStrSrc = wide_string_to_UTF8(SourceFilename);
+ char *pStrDest = DestinationFilename;
+ char *pStrSrc = SourceFilename;
char strDestFullPath[PATH_MAX * 2 + 1];
char strSrcFullPath[PATH_MAX * 2 + 1];
fchmod (dfd, st.st_mode & 0777);
close (sfd);
- if (pStrDest)
- {
- FREE(pStrDest);
- pStrDest = NULL;
- }
- if (pStrSrc)
- {
- FREE(pStrSrc);
- pStrSrc = NULL;
- }
return 0;
err:
unlink (pStrDest);
}
- if (pStrDest)
- {
- FREE(pStrDest);
- pStrDest = NULL;
- }
- if (pStrSrc)
- {
- FREE(pStrSrc);
- pStrSrc = NULL;
- }
return status;
}
/*--------------------------------------------------------------------------*/
-static int CopyDirectoryFunction_others(wchar_t *DestinationDirectory, wchar_t *SourceDirectory)
+static int CopyDirectoryFunction_others(char* DestinationDirectory, char* SourceDirectory)
{
- char *pStrDest = wide_string_to_UTF8(DestinationDirectory);
- char *pStrSrc = wide_string_to_UTF8(SourceDirectory);
+ char *pStrDest = DestinationDirectory;
+ char *pStrSrc = SourceDirectory;
int ierr = 0;
/* we check directory source exists */
if (!isdir(pStrSrc))
{
- if (pStrDest)
- {
- FREE(pStrDest);
- pStrDest = NULL;
- }
- FREE(pStrSrc);
return ENOTDIR;
}
/* we check destination directory exists */
if (!isdir(pStrDest))
{
- if (FileExistW(DestinationDirectory))
+ if (FileExist(pStrDest))
{
- FREE(pStrDest);
- FREE(pStrSrc);
return ENOTDIR;
}
else
{
- if (!createdirectoryW(DestinationDirectory))
+ if (!createdirectory(pStrDest))
{
- FREE(pStrDest);
- FREE(pStrSrc);
return ENOTDIR;
}
}
}
ierr = RecursiveCopyDirectory(pStrDest, pStrSrc);
-
- FREE(pStrDest);
- FREE(pStrSrc);
-
if (ierr)
{
return errno;
}
else
{
- wchar_t* wcfileDest = to_wide_string(filenameDST);
- wchar_t* wcfileSrc = to_wide_string(filenameSRC);
-
- int ierr = CopyFileFunction_others(wcfileDest, wcfileSrc);
- FREE(wcfileDest);
- FREE(wcfileSrc);
-
+ int ierr = CopyFileFunction_others(filenameDST, filenameSRC);
if (ierr)
{
FREE(filenameDST);
/*--------------------------------------------------------------------------*/
int CopyFileFunction(char* DestinationFilename, char* SourceFilename)
{
- if (stricmp(DestinationFilename, SourceFilename) == 0)
+ if (os_stricmp(DestinationFilename, SourceFilename) == 0)
{
SetLastError(ERROR_ACCESS_DENIED);
return 1;
DestinationDirectory[dstlen - 1] = '\0';
}
- if (stricmp(DestinationDirectory, SourceDirectory) == 0)
+ if (os_stricmp(DestinationDirectory, SourceDirectory) == 0)
{
SetLastError(ERROR_ACCESS_DENIED);
return 1;
#include "isdir.h"
#include "splitpath.h"
#include "scicurdir.h"
+#include "os_string.h"
+#ifndef _MSC_VER
+#define MAX_PATH PATH_MAX
+#endif
/*--------------------------------------------------------------------------*/
#define DIRMODE 0777
/*--------------------------------------------------------------------------*/
{
if (!isdir(path))
{
+#ifndef _MCS_VER
+ if (mkdir(path, DIRMODE) == 0)
+ {
+ bOK = TRUE;
+ }
+#else
char path_out[MAX_PATH];
char drv[MAX_PATH];
char dir[MAX_PATH];
splitpath(path, TRUE, drv, dir, NULL, NULL);
- strcpy(path_out, drv);
+ os_strcpy(path_out, drv);
strcat(path_out, dir);
//if there is no path_out, get current dir as reference.
}
cur = scigetcwd(&err);
- strcpy(path_out, cur);
+ os_strcpy(path_out, cur);
FREE(cur);
}
{
bOK = TRUE;
}
+#endif // _MCS_VER
+
}
}
return bOK;
}
-/*--------------------------------------------------------------------------*/
\ No newline at end of file
+/*--------------------------------------------------------------------------*/
return 0;
}
- if (stricmp(values[0]/*enabled*/, "true") == 0)
+ if (os_stricmp(values[0]/*enabled*/, "true") == 0)
{
const unsigned int ulen = (const unsigned int)strlen(values[3]);
const unsigned int plen = (const unsigned int)strlen(values[4]);
#include "Sciwarning.h"
/*--------------------------------------------------------------------------*/
#ifndef _MSC_VER
-static BOOL find_spec( char *filename , char *filespec);
+static BOOL find_spec(const char *filename , const char *filespec);
#endif
/*--------------------------------------------------------------------------*/
#ifdef _MSC_VER
* @param filename the filename
* @param filespec the mask
*/
-static BOOL find_spec( char *filename , char *filespec)
+static BOOL find_spec(const char *filename , const char *filespec)
{
char *any = NULL;
{
sciprint(_("Can't go to directory %s: %s\n"), path, strerror(errno));
}
- if (path)
- {
- FREE(path);
- path = NULL;
- }
return 1;
}
- if (path)
- {
- FREE(path);
- path = NULL;
- }
-
#else
if (_chdir(path) )
{
{
//errcatch
types::String* pS = in[1]->getAs<types::String>();
- if (stricmp(pS->get(0), "errcatch") == 0)
+ if (os_stricmp(pS->get(0), "errcatch") == 0)
{
bErrCatch = true;
}
//print msg about recursion limit and trigger an error
char sz[1024];
- os_sprintf(sz, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
+ os_sprintf(sz, 1024, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
throw ast::InternalError(sz);
}
}
//print msg about recursion limit and trigger an error
char sz[1024];
- os_sprintf(sz, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
+ os_sprintf(sz, 1024, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
throw ast::InternalError(sz);
}
}
}
types::String* pS = in[1]->getAs<types::String>();
- if (stricmp(pS->get(0), "errcatch") == 0)
+ if (os_stricmp(pS->get(0), "errcatch") == 0)
{
bErrCatch = true;
}
return types::Function::Error;
}
- if (stricmp(in[2]->getAs<types::String>()->get(0), MUTE_FLAG) == 0)
+ if (os_stricmp(in[2]->getAs<types::String>()->get(0), MUTE_FLAG) == 0)
{
bMute = true;
}
- else if (stricmp(in[2]->getAs<types::String>()->get(0), NO_MUTE_FLAG) == 0)
+ else if (os_stricmp(in[2]->getAs<types::String>()->get(0), NO_MUTE_FLAG) == 0)
{
bMute = false;
}
//print msg about recursion limit and trigger an error
char sz[1024];
- os_sprintf(sz, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
+ os_sprintf(sz, 1024, _("Recursion limit reached (%d).\n"), ConfigVariable::getRecursionLimit());
throw ast::InternalError(sz);
}
}
/* Don't care about line return / empty line */
xmlKeepBlanksDefault(0);
/* check if the XML file has been encoded with utf8 (unicode) or not */
- if (stricmp("utf-8", encoding) == 0)
+ if (os_stricmp("utf-8", encoding) == 0)
{
xmlDocPtr doc;
xmlXPathContextPtr xpathCtxt = NULL;
{
/* we found the tag activate */
const char *str = (const char*)attrib->children->content;
- if (stricmp(str, "yes") == 0 || strcmp(str, "1") == 0)
+ if (os_stricmp(str, "yes") == 0 || strcmp(str, "1") == 0)
{
activate = 1;
}
return 0;
}
- if (stricmp(str, "on") == 0)
+ if (os_stricmp(str, "on") == 0)
{
visible = 1;
}
- else if (stricmp(str, "off") == 0)
+ else if (os_stricmp(str, "off") == 0)
{
visible = 0;
}
return 0;
}
- if (stricmp(str, "directional") == 0)
+ if (os_stricmp(str, "directional") == 0)
{
type = 0;
}
- else if (stricmp(str, "point") == 0)
+ else if (os_stricmp(str, "point") == 0)
{
type = 1;
}
return 1;
}
- if ((pstProperty[0] == 'd' || pstProperty[0] == 'D') && stricmp("data", pstProperty) == 0)
+ if ((pstProperty[0] == 'd' || pstProperty[0] == 'D') && os_stricmp("data", pstProperty) == 0)
{
//send to datamodel
isData = 1;
}
- if (stricmp(pstProperty, "user_data") == 0 ||
- stricmp(pstProperty, "userdata") == 0 ||
- stricmp(pstProperty, "display_function_data") == 0 ||
- stricmp(pstProperty, "data") == 0)
+ if (os_stricmp(pstProperty, "user_data") == 0 ||
+ os_stricmp(pstProperty, "userdata") == 0 ||
+ os_stricmp(pstProperty, "display_function_data") == 0 ||
+ os_stricmp(pstProperty, "data") == 0)
{
/* in this case set_user_data_property
* directly uses the third position in the stack
case sci_strings :
if (strcmp(pstProperty, "tics_labels") != 0 && strcmp(pstProperty, "auto_ticks") != 0 && strcmp(pstProperty, "tight_limits") != 0 &&
strcmp(pstProperty, "axes_visible") != 0 && strcmp(pstProperty, "axes_reverse") != 0 &&
- strcmp(pstProperty, "text") != 0 && stricmp(pstProperty, "string") != 0 &&
- stricmp(pstProperty, "tooltipstring") != 0 && stricmp(pstProperty, "ticks_format") != 0) /* Added for uicontrols */
+ strcmp(pstProperty, "text") != 0 && os_stricmp(pstProperty, "string") != 0 &&
+ os_stricmp(pstProperty, "tooltipstring") != 0 && os_stricmp(pstProperty, "ticks_format") != 0) /* Added for uicontrols */
{
if (isScalar(pvApiCtx, piAddr3) == 0)
{
{
if (_iType == sci_strings)
{
- if (stricmp((char*)_pvData, "on") == 0)
+ if (os_stricmp((char*)_pvData, "on") == 0)
{
return TRUE;
}
- if (stricmp((char*)_pvData, "off") == 0)
+ if (os_stricmp((char*)_pvData, "off") == 0)
{
return FALSE;
}
- if (stricmp((char*)_pvData, "1") == 0)
+ if (os_stricmp((char*)_pvData, "1") == 0)
{
return TRUE;
}
- if (stricmp((char*)_pvData, "0") == 0)
+ if (os_stricmp((char*)_pvData, "0") == 0)
{
return FALSE;
}
- if (stricmp((char*)_pvData, "T") == 0)
+ if (os_stricmp((char*)_pvData, "T") == 0)
{
return TRUE;
}
- if (stricmp((char*)_pvData, "F") == 0)
+ if (os_stricmp((char*)_pvData, "F") == 0)
{
return FALSE;
}
/*--------------------------------------------------------------------------*/
static int setGetHashTableEqualKeys(void * k1, void * k2)
{
- if (stricmp((char *)k1, (char *)k2) == 0)
+ if (os_stricmp((char *)k1, (char *)k2) == 0)
{
return 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "left") == 0)
+ if (os_stricmp((char*)_pvData, "left") == 0)
{
alignment = 0;
}
- else if (stricmp((char*)_pvData, "center") == 0)
+ else if (os_stricmp((char*)_pvData, "center") == 0)
{
alignment = 1;
}
- else if (stricmp((char*)_pvData, "right") == 0)
+ else if (os_stricmp((char*)_pvData, "right") == 0)
{
alignment = 2;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "off") == 0)
+ if (os_stricmp((char*)_pvData, "off") == 0)
{
quality = 0;
}
- else if (stricmp((char*)_pvData, "2x") == 0)
+ else if (os_stricmp((char*)_pvData, "2x") == 0)
{
quality = 1;
}
- else if (stricmp((char*)_pvData, "4x") == 0)
+ else if (os_stricmp((char*)_pvData, "4x") == 0)
{
quality = 2;
}
- else if (stricmp((char*)_pvData, "8x") == 0)
+ else if (os_stricmp((char*)_pvData, "8x") == 0)
{
quality = 3;
}
- else if (stricmp((char*)_pvData, "16x") == 0)
+ else if (os_stricmp((char*)_pvData, "16x") == 0)
{
quality = 4;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "nurbs") == 0)
+ if (os_stricmp((char*)_pvData, "nurbs") == 0)
{
arcDrawingMethod = 0;
}
- else if (stricmp((char*)_pvData, "lines") == 0)
+ else if (os_stricmp((char*)_pvData, "lines") == 0)
{
arcDrawingMethod = 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp(pstType, "raised") == 0)
+ if (os_stricmp(pstType, "raised") == 0)
{
iType = 0;
}
- else if (stricmp(pstType, "lowered") == 0)
+ else if (os_stricmp(pstType, "lowered") == 0)
{
iType = 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp(pstType, "raised") == 0)
+ if (os_stricmp(pstType, "raised") == 0)
{
iType = 0;
}
- else if (stricmp(pstType, "lowered") == 0)
+ else if (os_stricmp(pstType, "lowered") == 0)
{
iType = 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp(pstJustification, "leading") == 0)
+ if (os_stricmp(pstJustification, "leading") == 0)
{
iJustification = 0;
}
- else if (stricmp(pstJustification, "left") == 0)
+ else if (os_stricmp(pstJustification, "left") == 0)
{
iJustification = 1;
}
- else if (stricmp(pstJustification, "center") == 0)
+ else if (os_stricmp(pstJustification, "center") == 0)
{
iJustification = 2;
}
- else if (stricmp(pstJustification, "right") == 0)
+ else if (os_stricmp(pstJustification, "right") == 0)
{
iJustification = 3;
}
- else if (stricmp(pstJustification, "trailing") == 0)
+ else if (os_stricmp(pstJustification, "trailing") == 0)
{
iJustification = 4;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp(pstPosition, "top") == 0)
+ if (os_stricmp(pstPosition, "top") == 0)
{
iPosition = 0;
}
- else if (stricmp(pstPosition, "above_top") == 0)
+ else if (os_stricmp(pstPosition, "above_top") == 0)
{
iPosition = 1;
}
- else if (stricmp(pstPosition, "below_top") == 0)
+ else if (os_stricmp(pstPosition, "below_top") == 0)
{
iPosition = 2;
}
- else if (stricmp(pstPosition, "bottom") == 0)
+ else if (os_stricmp(pstPosition, "bottom") == 0)
{
iPosition = 3;
}
- else if (stricmp(pstPosition, "above_bottom") == 0)
+ else if (os_stricmp(pstPosition, "above_bottom") == 0)
{
iPosition = 4;
}
- else if (stricmp(pstPosition, "below_bottom") == 0)
+ else if (os_stricmp(pstPosition, "below_bottom") == 0)
{
iPosition = 5;
}
{
int boxType;
- if (stricmp((char*)_pvData, "off") == 0)
+ if (os_stricmp((char*)_pvData, "off") == 0)
{
boxType = 0;
}
- else if (stricmp((char*)_pvData, "on") == 0)
+ else if (os_stricmp((char*)_pvData, "on") == 0)
{
boxType = 1;
}
- else if (stricmp((char*)_pvData, "hidden_axes") == 0)
+ else if (os_stricmp((char*)_pvData, "hidden_axes") == 0)
{
boxType = 2;
}
- else if (stricmp((char*)_pvData, "back_half") == 0)
+ else if (os_stricmp((char*)_pvData, "back_half") == 0)
{
boxType = 3;
}
- else if (stricmp((char*)_pvData, "hidden_axis") == 0)
+ else if (os_stricmp((char*)_pvData, "hidden_axis") == 0)
{
Sciwarning(_("WARNING !!!\nIn '%s' property: '%s' is deprecated use '%s' instead.\n"), "box", "hidden_axis", "hidden_axes");
boxType = 2;
{
int box;
- if (stricmp((char*)_pvData, "on") == 0)
+ if (os_stricmp((char*)_pvData, "on") == 0)
{
box = 1;
}
- else if (stricmp((char*)_pvData, "off") == 0)
+ else if (os_stricmp((char*)_pvData, "off") == 0)
{
box = 0;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "scaled") == 0)
+ if (os_stricmp((char*)_pvData, "scaled") == 0)
{
cdataMapping = 0;
}
- else if (stricmp((char*)_pvData, "direct") == 0)
+ else if (os_stricmp((char*)_pvData, "direct") == 0)
{
cdataMapping = 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "clipgrf") == 0)
+ if (os_stricmp((char*)_pvData, "clipgrf") == 0)
{
clipState = 1;
}
- else if (stricmp((char*)_pvData, "off") == 0)
+ else if (os_stricmp((char*)_pvData, "off") == 0)
{
clipState = 0;
}
- else if (stricmp((char*)_pvData, "on") == 0)
+ else if (os_stricmp((char*)_pvData, "on") == 0)
{
clipState = 2;
}
}
//convert string value to enum
- if (stricmp(pstPos, "center") == 0)
+ if (os_stricmp(pstPos, "center") == 0)
{
iPos = BORDER_CENTER;
}
- else if (stricmp(pstPos, "bottom") == 0)
+ else if (os_stricmp(pstPos, "bottom") == 0)
{
iPos = BORDER_BOTTOM;
}
- else if (stricmp(pstPos, "top") == 0)
+ else if (os_stricmp(pstPos, "top") == 0)
{
iPos = BORDER_TOP;
}
- else if (stricmp(pstPos, "left") == 0)
+ else if (os_stricmp(pstPos, "left") == 0)
{
iPos = BORDER_LEFT;
}
- else if (stricmp(pstPos, "right") == 0)
+ else if (os_stricmp(pstPos, "right") == 0)
{
iPos = BORDER_RIGHT;
}
}
//convert string value to enum
- if (stricmp(pstFill, "none") == 0)
+ if (os_stricmp(pstFill, "none") == 0)
{
iFill = FILL_NONE;
}
- else if (stricmp(pstFill, "horizontal") == 0)
+ else if (os_stricmp(pstFill, "horizontal") == 0)
{
iFill = FILL_HORIZONTAL;
}
- else if (stricmp(pstFill, "vertical") == 0)
+ else if (os_stricmp(pstFill, "vertical") == 0)
{
iFill = FILL_VERTICAL;
}
- else if (stricmp(pstFill, "both") == 0)
+ else if (os_stricmp(pstFill, "both") == 0)
{
iFill = FILL_BOTH;
}
}
//convert string value to enum
- if (stricmp(pstAnchor, "center") == 0)
+ if (os_stricmp(pstAnchor, "center") == 0)
{
iAnchor = ANCHOR_CENTER;
}
- else if (stricmp(pstAnchor, "upper") == 0)
+ else if (os_stricmp(pstAnchor, "upper") == 0)
{
iAnchor = ANCHOR_UPPER;
}
- else if (stricmp(pstAnchor, "lower") == 0)
+ else if (os_stricmp(pstAnchor, "lower") == 0)
{
iAnchor = ANCHOR_LOWER;
}
- else if (stricmp(pstAnchor, "right") == 0)
+ else if (os_stricmp(pstAnchor, "right") == 0)
{
iAnchor = ANCHOR_RIGHT;
}
- else if (stricmp(pstAnchor, "left") == 0)
+ else if (os_stricmp(pstAnchor, "left") == 0)
{
iAnchor = ANCHOR_LEFT;
}
- else if (stricmp(pstAnchor, "upper_right") == 0)
+ else if (os_stricmp(pstAnchor, "upper_right") == 0)
{
iAnchor = ANCHOR_UPPER_RIGHT;
}
- else if (stricmp(pstAnchor, "upper_left") == 0)
+ else if (os_stricmp(pstAnchor, "upper_left") == 0)
{
iAnchor = ANCHOR_UPPER_LEFT;
}
- else if (stricmp(pstAnchor, "lower_right") == 0)
+ else if (os_stricmp(pstAnchor, "lower_right") == 0)
{
iAnchor = ANCHOR_LOWER_RIGHT;
}
- else if (stricmp(pstAnchor, "lower_left") == 0)
+ else if (os_stricmp(pstAnchor, "lower_left") == 0)
{
iAnchor = ANCHOR_LOWER_LEFT;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "scaled") == 0)
+ if (os_stricmp((char*)_pvData, "scaled") == 0)
{
dataMapping = 0;
}
- else if (stricmp((char*)_pvData, "direct") == 0)
+ else if (os_stricmp((char*)_pvData, "direct") == 0)
{
dataMapping = 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "old") == 0)
+ if (os_stricmp((char*)_pvData, "old") == 0)
{
Scierror(999, _("Old graphic mode is no longer available. Please refer to the set help page.\n"));
return SET_PROPERTY_ERROR;
}
- else if (stricmp((char*)_pvData, "new") == 0)
+ else if (os_stricmp((char*)_pvData, "new") == 0)
{
/* graphic mode must be new */
/* nothing to do */
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "foreground") == 0)
+ if (os_stricmp((char*)_pvData, "foreground") == 0)
{
position = 1;
}
- else if (stricmp((char*)_pvData, "background") == 0)
+ else if (os_stricmp((char*)_pvData, "background") == 0)
{
position = 0;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "rgb") == 0)
+ if (os_stricmp((char*)_pvData, "rgb") == 0)
{
imagetype = (int)MATPLOT_RGB;
}
- else if (stricmp((char*)_pvData, "rgba") == 0)
+ else if (os_stricmp((char*)_pvData, "rgba") == 0)
{
imagetype = (int)MATPLOT_RGBA;
}
- else if (stricmp((char*)_pvData, "argb") == 0)
+ else if (os_stricmp((char*)_pvData, "argb") == 0)
{
imagetype = (int)MATPLOT_ARGB;
}
- else if (stricmp((char*)_pvData, "gray") == 0)
+ else if (os_stricmp((char*)_pvData, "gray") == 0)
{
imagetype = (int)MATPLOT_GRAY;
}
- else if (stricmp((char*)_pvData, "index") == 0)
+ else if (os_stricmp((char*)_pvData, "index") == 0)
{
imagetype = (int)MATPLOT_INDEX;
}
- else if (stricmp((char*)_pvData, "red") == 0)
+ else if (os_stricmp((char*)_pvData, "red") == 0)
{
imagetype = (int)MATPLOT_RED;
}
- else if (stricmp((char*)_pvData, "green") == 0)
+ else if (os_stricmp((char*)_pvData, "green") == 0)
{
imagetype = (int)MATPLOT_GREEN;
}
- else if (stricmp((char*)_pvData, "blue") == 0)
+ else if (os_stricmp((char*)_pvData, "blue") == 0)
{
imagetype = (int)MATPLOT_BLUE;
}
- else if (stricmp((char*)_pvData, "rgb332") == 0)
+ else if (os_stricmp((char*)_pvData, "rgb332") == 0)
{
imagetype = (int)MATPLOT_RGB_332;
}
- else if (stricmp((char*)_pvData, "rgb444") == 0)
+ else if (os_stricmp((char*)_pvData, "rgb444") == 0)
{
imagetype = (int)MATPLOT_RGB_444;
}
- else if (stricmp((char*)_pvData, "rgba4444") == 0)
+ else if (os_stricmp((char*)_pvData, "rgba4444") == 0)
{
imagetype = (int)MATPLOT_RGBA_4444;
}
- else if (stricmp((char*)_pvData, "rgb555") == 0)
+ else if (os_stricmp((char*)_pvData, "rgb555") == 0)
{
imagetype = (int)MATPLOT_RGB_555;
}
- else if (stricmp((char*)_pvData, "rgba5551") == 0)
+ else if (os_stricmp((char*)_pvData, "rgba5551") == 0)
{
imagetype = (int)MATPLOT_RGBA_5551;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "none") == 0)
+ if (os_stricmp((char*)_pvData, "none") == 0)
{
layout = LAYOUT_NONE;
}
- else if (stricmp((char*)_pvData, "gridbag") == 0)
+ else if (os_stricmp((char*)_pvData, "gridbag") == 0)
{
layout = LAYOUT_GRIDBAG;
}
- else if (stricmp((char*)_pvData, "grid") == 0)
+ else if (os_stricmp((char*)_pvData, "grid") == 0)
{
layout = LAYOUT_GRID;
}
- else if (stricmp((char*)_pvData, "border") == 0)
+ else if (os_stricmp((char*)_pvData, "border") == 0)
{
layout = LAYOUT_BORDER;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "directional") == 0)
+ if (os_stricmp((char*)_pvData, "directional") == 0)
{
val = 0;
}
- else if (stricmp((char*)_pvData, "point") == 0)
+ else if (os_stricmp((char*)_pvData, "point") == 0)
{
val = 1;
}
}
/* 0 : point, 1 : tabulated */
- if (stricmp((char*)_pvData, "point") == 0)
+ if (os_stricmp((char*)_pvData, "point") == 0)
{
markSizeUnit = 0;
}
- else if (stricmp((char*)_pvData, "tabulated") == 0)
+ else if (os_stricmp((char*)_pvData, "tabulated") == 0)
{
markSizeUnit = 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "none") == 0)
+ if (os_stricmp((char*)_pvData, "none") == 0)
{
menu = NONE;
}
- else if (stricmp((char*)_pvData, "figure") == 0)
+ else if (os_stricmp((char*)_pvData, "figure") == 0)
{
menu = FIGURE;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "unary") == 0)
+ if (os_stricmp((char*)_pvData, "unary") == 0)
{
rotationStyle = 0;
}
- else if (stricmp((char*)_pvData, "multiple") == 0)
+ else if (os_stricmp((char*)_pvData, "multiple") == 0)
{
rotationStyle = 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "top") == 0)
+ if (os_stricmp((char*)_pvData, "top") == 0)
{
pos = TITLE_TOP;
}
- else if (stricmp((char*)_pvData, "left") == 0)
+ else if (os_stricmp((char*)_pvData, "left") == 0)
{
pos = TITLE_LEFT;
}
- else if (stricmp((char*)_pvData, "bottom") == 0)
+ else if (os_stricmp((char*)_pvData, "bottom") == 0)
{
pos = TITLE_BOTTOM;
}
- else if (stricmp((char*)_pvData, "right") == 0)
+ else if (os_stricmp((char*)_pvData, "right") == 0)
{
pos = TITLE_RIGHT;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "off") == 0)
+ if (os_stricmp((char*)_pvData, "off") == 0)
{
autoSize = 1;
textBoxMode = 0;
}
- else if (stricmp((char*)_pvData, "centered") == 0)
+ else if (os_stricmp((char*)_pvData, "centered") == 0)
{
autoSize = 1;
textBoxMode = 1;
}
- else if (stricmp((char*)_pvData, "filled") == 0)
+ else if (os_stricmp((char*)_pvData, "filled") == 0)
{
autoSize = 0;
textBoxMode = 2;
if (yNumberTicks == 1)
{
- if (stricmp((char*)_pvData, "top") == 0)
+ if (os_stricmp((char*)_pvData, "top") == 0)
{
ticksDirection = 0;
}
- else if (stricmp((char*)_pvData, "bottom") == 0)
+ else if (os_stricmp((char*)_pvData, "bottom") == 0)
{
ticksDirection = 1;
}
}
else
{
- if (stricmp((char*)_pvData, "left") == 0)
+ if (os_stricmp((char*)_pvData, "left") == 0)
{
ticksDirection = 2;
}
- else if (stricmp((char*)_pvData, "right") == 0)
+ else if (os_stricmp((char*)_pvData, "right") == 0)
{
ticksDirection = 3;
}
return SET_PROPERTY_ERROR;
}
- if ( stricmp((char*)_pvData, "v") != 0 &&
- stricmp((char*)_pvData, "r") != 0 &&
- stricmp((char*)_pvData, "i") != 0)
+ if ( os_stricmp((char*)_pvData, "v") != 0 &&
+ os_stricmp((char*)_pvData, "r") != 0 &&
+ os_stricmp((char*)_pvData, "i") != 0)
{
Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "tics_style", "v, r, i");
return SET_PROPERTY_ERROR;
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "none") == 0)
+ if (os_stricmp((char*)_pvData, "none") == 0)
{
tool = NONE;
}
- else if (stricmp((char*)_pvData, "figure") == 0)
+ else if (os_stricmp((char*)_pvData, "figure") == 0)
{
tool = FIGURE;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "2d") == 0)
+ if (os_stricmp((char*)_pvData, "2d") == 0)
{
viewType = 0;
}
- else if (stricmp((char*)_pvData, "3d") == 0)
+ else if (os_stricmp((char*)_pvData, "3d") == 0)
{
viewType = 1;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "bottom") == 0)
+ if (os_stricmp((char*)_pvData, "bottom") == 0)
{
axisLocation = 0;
}
- else if (stricmp((char*)_pvData, "top") == 0)
+ else if (os_stricmp((char*)_pvData, "top") == 0)
{
axisLocation = 1;
}
- else if (stricmp((char*)_pvData, "middle") == 0)
+ else if (os_stricmp((char*)_pvData, "middle") == 0)
{
axisLocation = 2;
}
- else if (stricmp((char*)_pvData, "origin") == 0)
+ else if (os_stricmp((char*)_pvData, "origin") == 0)
{
axisLocation = 3;
}
return SET_PROPERTY_ERROR;
}
- if (stricmp((char*)_pvData, "left") == 0)
+ if (os_stricmp((char*)_pvData, "left") == 0)
{
axisLocation = 4;
}
- else if (stricmp((char*)_pvData, "right") == 0)
+ else if (os_stricmp((char*)_pvData, "right") == 0)
{
axisLocation = 5;
}
- else if (stricmp((char*)_pvData, "middle") == 0)
+ else if (os_stricmp((char*)_pvData, "middle") == 0)
{
axisLocation = 2;
}
- else if (stricmp((char*)_pvData, "origin") == 0)
+ else if (os_stricmp((char*)_pvData, "origin") == 0)
{
axisLocation = 3;
}
int colorSize2 = sizeof(colorRGB) / (sizeof(int) * 3);
for (i = 0 ; i < colorSize ; i++)
{
- if (stricmp(colorName[i], color) == 0)
+ if (os_stricmp(colorName[i], color) == 0)
{
_pdblRGB[0] = (double)colorRGB[i][0];
_pdblRGB[1] = (double)colorRGB[i][1];
return 1;
}
- if (stricmp(pstProName, "dockable") != 0 &&
- stricmp(pstProName, "toolbar") != 0 &&
- stricmp(pstProName, "menubar") != 0 &&
- stricmp(pstProName, "default_axes") != 0 &&
- stricmp(pstProName, "visible") != 0 &&
- stricmp(pstProName, "figure_size") != 0 &&
- stricmp(pstProName, "axes_size") != 0 &&
- stricmp(pstProName, "position") != 0 &&
- stricmp(pstProName, "menubar_visible") != 0 &&
- stricmp(pstProName, "toolbar_visible") != 0 &&
- stricmp(pstProName, "resize") != 0 &&
- stricmp(pstProName, "infobar_visible") != 0)
+ if (os_stricmp(pstProName, "dockable") != 0 &&
+ os_stricmp(pstProName, "toolbar") != 0 &&
+ os_stricmp(pstProName, "menubar") != 0 &&
+ os_stricmp(pstProName, "default_axes") != 0 &&
+ os_stricmp(pstProName, "visible") != 0 &&
+ os_stricmp(pstProName, "figure_size") != 0 &&
+ os_stricmp(pstProName, "axes_size") != 0 &&
+ os_stricmp(pstProName, "position") != 0 &&
+ os_stricmp(pstProName, "menubar_visible") != 0 &&
+ os_stricmp(pstProName, "toolbar_visible") != 0 &&
+ os_stricmp(pstProName, "resize") != 0 &&
+ os_stricmp(pstProName, "infobar_visible") != 0)
{
freeAllocatedSingleString(pstProName);
continue;
}
//check property value to compatibility
- if (stricmp(pstProName, "dockable") == 0)
+ if (os_stricmp(pstProName, "dockable") == 0)
{
bDockable = getStackArgumentAsBoolean(pvApiCtx, piAddrData);
if (bDockable == -1)
return 1;
}
}
- else if (stricmp(pstProName, "toolbar") == 0)
+ else if (os_stricmp(pstProName, "toolbar") == 0)
{
char* pstVal = NULL;
if (isStringType(pvApiCtx, piAddrData) == FALSE || isScalar(pvApiCtx, piAddrData) == FALSE)
getAllocatedSingleString(pvApiCtx, piAddrData, &pstVal);
- if (stricmp(pstVal, "none") == 0)
+ if (os_stricmp(pstVal, "none") == 0)
{
iToolbarType = 0;
}
- else if (stricmp(pstVal, "figure") == 0)
+ else if (os_stricmp(pstVal, "figure") == 0)
{
iToolbarType = 1;
}
freeAllocatedSingleString(pstVal);
}
- else if (stricmp(pstProName, "menubar") == 0)
+ else if (os_stricmp(pstProName, "menubar") == 0)
{
char* pstVal = NULL;
if (isStringType(pvApiCtx, piAddrData) == FALSE || isScalar(pvApiCtx, piAddrData) == FALSE)
getAllocatedSingleString(pvApiCtx, piAddrData, &pstVal);
- if (stricmp(pstVal, "none") == 0)
+ if (os_stricmp(pstVal, "none") == 0)
{
iMenubarType = 0;
}
- else if (stricmp(pstVal, "figure") == 0)
+ else if (os_stricmp(pstVal, "figure") == 0)
{
iMenubarType = 1;
}
freeAllocatedSingleString(pstVal);
}
- else if (stricmp(pstProName, "default_axes") == 0)
+ else if (os_stricmp(pstProName, "default_axes") == 0)
{
bDefaultAxes = getStackArgumentAsBoolean(pvApiCtx, piAddrData);
if (bDefaultAxes == -1)
return 1;
}
}
- else if (stricmp(pstProName, "visible") == 0)
+ else if (os_stricmp(pstProName, "visible") == 0)
{
bVisible = getStackArgumentAsBoolean(pvApiCtx, piAddrData);
if (bVisible == -1)
return 1;
}
}
- else if (stricmp(pstProName, "figure_size") == 0)
+ else if (os_stricmp(pstProName, "figure_size") == 0)
{
int iRows = 0;
int iCols = 0;
return 1;
}
}
- else if (stricmp(pstProName, "axes_size") == 0)
+ else if (os_stricmp(pstProName, "axes_size") == 0)
{
int iRows = 0;
int iCols = 0;
return 1;
}
}
- else if (stricmp(pstProName, "position") == 0)
+ else if (os_stricmp(pstProName, "position") == 0)
{
int iRows = 0;
int iCols = 0;
return 1;
}
}
- else if (stricmp(pstProName, "resize") == 0)
+ else if (os_stricmp(pstProName, "resize") == 0)
{
bResize = getStackArgumentAsBoolean(pvApiCtx, piAddrData);
if (bResize == -1)
return 1;
}
}
- else if (stricmp(pstProName, "menubar_visible") == 0)
+ else if (os_stricmp(pstProName, "menubar_visible") == 0)
{
bMenuBar = getStackArgumentAsBoolean(pvApiCtx, piAddrData);
if (bMenuBar == -1)
return 1;
}
}
- else if (stricmp(pstProName, "toolbar_visible") == 0)
+ else if (os_stricmp(pstProName, "toolbar_visible") == 0)
{
bToolBar = getStackArgumentAsBoolean(pvApiCtx, piAddrData);
if (bToolBar == -1)
return 1;
}
}
- else if (stricmp(pstProName, "infobar_visible") == 0)
+ else if (os_stricmp(pstProName, "infobar_visible") == 0)
{
bInfoBar = getStackArgumentAsBoolean(pvApiCtx, piAddrData);
if (bInfoBar == -1)
}
if (bDoCreation && (
- stricmp(pstProName, "dockable") == 0 ||
- stricmp(pstProName, "toolbar") == 0 ||
- stricmp(pstProName, "menubar") == 0 ||
- stricmp(pstProName, "default_axes") == 0 ||
- stricmp(pstProName, "visible") == 0 ||
- stricmp(pstProName, "figure_size") == 0 ||
- stricmp(pstProName, "axes_size") == 0 ||
- stricmp(pstProName, "position") == 0 ||
- stricmp(pstProName, "resize") == 0 ||
- stricmp(pstProName, "menubar_visible") == 0 ||
- stricmp(pstProName, "toolbar_visible") == 0 ||
- stricmp(pstProName, "infobar_visible") == 0))
+ os_stricmp(pstProName, "dockable") == 0 ||
+ os_stricmp(pstProName, "toolbar") == 0 ||
+ os_stricmp(pstProName, "menubar") == 0 ||
+ os_stricmp(pstProName, "default_axes") == 0 ||
+ os_stricmp(pstProName, "visible") == 0 ||
+ os_stricmp(pstProName, "figure_size") == 0 ||
+ os_stricmp(pstProName, "axes_size") == 0 ||
+ os_stricmp(pstProName, "position") == 0 ||
+ os_stricmp(pstProName, "resize") == 0 ||
+ os_stricmp(pstProName, "menubar_visible") == 0 ||
+ os_stricmp(pstProName, "toolbar_visible") == 0 ||
+ os_stricmp(pstProName, "infobar_visible") == 0))
{
// Already set creating new figure
// but let the set_ function fail if figure already exists
getVarType(pvApiCtx, piAddrData, &iType);
- if ((strcmp(pstProName, "user_data") == 0) || (stricmp(pstProName, "userdata") == 0))
+ if ((strcmp(pstProName, "user_data") == 0) || (os_stricmp(pstProName, "userdata") == 0))
{
/* in this case set_user_data_property
* directly uses the third position in the stack
case sci_strings :
if ( strcmp(pstProName, "tics_labels") != 0 && strcmp(pstProName, "auto_ticks") != 0 &&
strcmp(pstProName, "axes_visible") != 0 && strcmp(pstProName, "axes_reverse") != 0 &&
- strcmp(pstProName, "text") != 0 && stricmp(pstProName, "string") != 0 &&
- stricmp(pstProName, "tooltipstring") != 0) /* Added for uicontrols */
+ strcmp(pstProName, "text") != 0 && os_stricmp(pstProName, "string") != 0 &&
+ os_stricmp(pstProName, "tooltipstring") != 0) /* Added for uicontrols */
{
if (getAllocatedSingleString(pvApiCtx, piAddrData, (char**)&_pvData))
{
// * add it to colormap => performed by callSetProperty
// * set background to index => performed by callSetProperty
// * copy value into axes background property
- if (stricmp(pstProName, "backgroundcolor") == 0 && iAxes > 0)
+ if (os_stricmp(pstProName, "backgroundcolor") == 0 && iAxes > 0)
{
int iBackground = 0;
int *piBackground = &iBackground;
char* pst = NULL;
getAllocatedSingleString(_pvCtx, _piAddr, &pst);
- if (stricmp(pst, "on") == 0)
+ if (os_stricmp(pst, "on") == 0)
{
ret = TRUE;
}
/* Modal ? */
if (modalOptionAdr != NULL)
{
- setMessageBoxModal(messageBoxID, !stricmp(modalOptionAdr[0], "modal"));
+ setMessageBoxModal(messageBoxID, !os_stricmp(modalOptionAdr[0], "modal"));
freeAllocatedMatrixOfString(nbRow, nbCol, modalOptionAdr);
}
else
{
if (strlen(propertyName) <= strlen(propertiesNames[k]))
{
- if (strnicmp(propertyName, propertiesNames[k], strlen(propertyName)) == 0)
+ if (os_strnicmp(propertyName, propertiesNames[k], strlen(propertyName)) == 0)
{
propertiesValuesIndices[k] = inputIndex + 1; /* Position of value for property */
found = 1;
return 1;
}
- if (stricmp(propertyName, "parent") == 0)
+ if (os_stricmp(propertyName, "parent") == 0)
{
parentDefined = TRUE;
}
- isUserDataProperty = (stricmp(propertyName, "user_data") == 0) || (stricmp(propertyName, "userdata") == 0);
+ isUserDataProperty = (os_stricmp(propertyName, "user_data") == 0) || (os_stricmp(propertyName, "userdata") == 0);
}
sciErr = getVarAddressFromPosition(pvApiCtx, iPropertyValuePositionIndex, &piAddrValue);
return iRet;
}
- compVar = stricmp(pstData, "upper left");
+ compVar = os_stricmp(pstData, "upper left");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 0);
return 0;
}
- compVar = stricmp(pstData, "upper right");
+ compVar = os_stricmp(pstData, "upper right");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 1);
return 0;
}
- compVar = stricmp(pstData, "lower left");
+ compVar = os_stricmp(pstData, "lower left");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 2);
return 0;
}
- compVar = stricmp(pstData, "lower right");
+ compVar = os_stricmp(pstData, "lower right");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 3);
return 0;
}
- compVar = stricmp(pstData, "left");
+ compVar = os_stricmp(pstData, "left");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 4);
return 0;
}
- compVar = stricmp(pstData, "right");
+ compVar = os_stricmp(pstData, "right");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 5);
return 0;
}
- compVar = stricmp(pstData, "upper");
+ compVar = os_stricmp(pstData, "upper");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 6);
return 0;
}
- compVar = stricmp(pstData, "lower");
+ compVar = os_stricmp(pstData, "lower");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 7);
return 0;
}
- compVar = stricmp(pstData, "automatic");
+ compVar = os_stricmp(pstData, "automatic");
if (compVar == 0)
{
DatatipOrientation::datatipSetOrientation(getScilabJavaVM(), iDatatipUID, (char*)pstData, 8);
int isModalOption(char *option)
{
- return (!stricmp(option, "modal") || !stricmp(option, "non-modal"));
+ return (!os_stricmp(option, "modal") || !os_stricmp(option, "non-modal"));
}
/*--------------------------------------------------------------------------*/
int isIconName(char *name)
{
- return (stricmp(name, "scilab")
- || stricmp(name, "error")
- || stricmp(name, "hourglass")
- || stricmp(name, "info")
- || stricmp(name, "passwd")
- || stricmp(name, "question")
- || stricmp(name, "warning"));
+ return (os_stricmp(name, "scilab")
+ || os_stricmp(name, "error")
+ || os_stricmp(name, "hourglass")
+ || os_stricmp(name, "info")
+ || os_stricmp(name, "passwd")
+ || os_stricmp(name, "question")
+ || os_stricmp(name, "warning"));
}
/*--------------------------------------------------------------------------*/
void* flag = NULL;
- if (!stricmp(propertyName, "screensize_px"))
+ if (!os_stricmp(propertyName, "screensize_px"))
{
value[0] = 1.0;
value[1] = 1.0;
return flag;
}
- else if (!stricmp(propertyName, "screensize_mm"))
+ else if (!os_stricmp(propertyName, "screensize_mm"))
{
value[0] = 0.0;
value[1] = 0.0;
return flag;
}
- else if (!stricmp(propertyName, "screensize_cm"))
+ else if (!os_stricmp(propertyName, "screensize_cm"))
{
value[0] = 0.0;
value[1] = 0.0;
return flag;
}
- else if (!stricmp(propertyName, "screensize_in"))
+ else if (!os_stricmp(propertyName, "screensize_in"))
{
value[0] = 0.0;
value[1] = 0.0;
return flag;
}
- else if (!stricmp(propertyName, "screensize_pt"))
+ else if (!os_stricmp(propertyName, "screensize_pt"))
{
value[0] = 0.0;
value[1] = 0.0;
return flag;
}
- else if (!stricmp(propertyName, "screensize_norm"))
+ else if (!os_stricmp(propertyName, "screensize_norm"))
{
value[0] = 0.0;
value[1] = 0.0;
return flag;
}
- else if (!stricmp(propertyName, "screendepth"))
+ else if (!os_stricmp(propertyName, "screendepth"))
{
value[0] = CallScilabBridge::getScreenDepth(getScilabJavaVM());
fontAngle = (char*)_pvData;
- if (stricmp(fontAngle, "normal") != 0
- && stricmp(fontAngle, "italic") != 0
- && stricmp(fontAngle, "oblique") != 0)
+ if (os_stricmp(fontAngle, "normal") != 0
+ && os_stricmp(fontAngle, "italic") != 0
+ && os_stricmp(fontAngle, "oblique") != 0)
{
/* Wrong string format */
Scierror(999, const_cast<char*>(_("Wrong value for '%s' property: '%s', '%s' or '%s' expected.\n")), "FontAngle", "normal", "italic", "oblique");
fontWeight = (char*)_pvData;
- if (stricmp(fontWeight, "light") != 0
- && stricmp(fontWeight, "normal") != 0
- && stricmp(fontWeight, "demi") != 0
- && stricmp(fontWeight, "bold") != 0)
+ if (os_stricmp(fontWeight, "light") != 0
+ && os_stricmp(fontWeight, "normal") != 0
+ && os_stricmp(fontWeight, "demi") != 0
+ && os_stricmp(fontWeight, "bold") != 0)
{
/* Wrong string format */
Scierror(999, const_cast<char*>(_("Wrong value for '%s' property: '%s', '%s', '%s' or '%s' expected.\n")), "FontWeight", "light", "normal", "demi", "bold");
alignment = (char*)_pvData;
- if (stricmp(alignment, "left") != 0
- && stricmp(alignment, "center") != 0
- && stricmp(alignment, "right") != 0)
+ if (os_stricmp(alignment, "left") != 0
+ && os_stricmp(alignment, "center") != 0
+ && os_stricmp(alignment, "right") != 0)
{
/* Wrong string format */
Scierror(999, const_cast<char*>(_("Wrong value for '%s' property: '%s', '%s' or '%s' expected.\n")), "HorizontalAlignment", "left", "center", "right");
relief = (char*)_pvData;
- if (stricmp(relief, "flat") != 0
- && stricmp(relief, "groove") != 0
- && stricmp(relief, "raised") != 0
- && stricmp(relief, "ridge") != 0
- && stricmp(relief, "solid") != 0
- && stricmp(relief, "sunken") != 0
- && stricmp(relief, "default") != 0)
+ if (os_stricmp(relief, "flat") != 0
+ && os_stricmp(relief, "groove") != 0
+ && os_stricmp(relief, "raised") != 0
+ && os_stricmp(relief, "ridge") != 0
+ && os_stricmp(relief, "solid") != 0
+ && os_stricmp(relief, "sunken") != 0
+ && os_stricmp(relief, "default") != 0)
{
/* Wrong string format */
Scierror(999, const_cast<char*>(_("Wrong type for '%s' property: '%s', '%s', '%s', '%s', '%s', '%s' or '%s' expected.\n")), "Relief", "flat", "groove", "raised", "ridge", "solid", "sunken", "default");
units = (char*)_pvData;
- if (stricmp(units, "points") != 0
- && stricmp(units, "normalized") != 0
- && stricmp(units, "inches") != 0
- && stricmp(units, "centimeters") != 0
- && stricmp(units, "pixels") != 0)
+ if (os_stricmp(units, "points") != 0
+ && os_stricmp(units, "normalized") != 0
+ && os_stricmp(units, "inches") != 0
+ && os_stricmp(units, "centimeters") != 0
+ && os_stricmp(units, "pixels") != 0)
{
/* Wrong string value */
Scierror(999, const_cast<char*>(_("Wrong value for '%s' property: '%s', '%s', '%s', '%s' or '%s' expected.\n")), "Units", "points", "normalized", "inches", "centimeters", "pixels");
alignment = (char*)_pvData;
- if (stricmp(alignment, "top") != 0
+ if (os_stricmp(alignment, "top") != 0
&& strcmp(alignment, "middle") != 0
&& strcmp(alignment, "bottom") != 0)
{
std::vector<std::string> success_files;
std::vector<std::string> funcs;
+ int size = PATH_MAX + FILENAME_MAX;
char pstParseFile[PATH_MAX + FILENAME_MAX];
char pstVerbose[65535];
delete pS;
}
- os_sprintf(pstParseFile, "%slib", pstParsePath);
+ os_sprintf(pstParseFile, size, "%slib", pstParsePath);
if (bVerbose)
{
- os_sprintf(pstVerbose, _("-- Creation of [%s] (Macros) --\n"), pstLibName);
+ os_sprintf(pstVerbose, 65535, _("-- Creation of [%s] (Macros) --\n"), pstLibName);
//save current prompt mode
int oldVal = ConfigVariable::getPromptMode();
if (pWriter == NULL)
{
- os_sprintf(pstVerbose, _("%s: Cannot open file ''%s''.\n"), "genlib", pstParseFile);
+ os_sprintf(pstVerbose, 65535, _("%s: Cannot open file ''%s''.\n"), "genlib", pstParseFile);
scilabWrite(pstVerbose);
out.push_back(new types::Bool(0));
std::string strErr(parser.getErrorMessage());
char errmsg[256];
- os_sprintf(errmsg, _("%s: Error in file %s.\n"), "genlib", stFullPath.data());
+ os_sprintf(errmsg, 256, _("%s: Error in file %s.\n"), "genlib", stFullPath.data());
strErr += errmsg;
Scierror(999, strErr.data());
{
if (AddMacroToXML(pWriter, name, pstPathBin, s_md5) == false)
{
- os_sprintf(pstVerbose, _("%s: Warning: %s information cannot be added to file %s. File ignored\n"), "genlib", pFD->getSymbol().getName().c_str(), pstPath[k]);
+ os_sprintf(pstVerbose, 65535, _("%s: Warning: %s information cannot be added to file %s. File ignored\n"), "genlib", pFD->getSymbol().getName().c_str(), pstPath[k]);
scilabWrite(pstVerbose);
}
{
return false;
}
-
+
//Add attribute "file"
iLen = xmlTextWriterWriteAttribute(_pWriter, (xmlChar*)"file", (xmlChar*)file.data());
if (iLen < 0)
/* Don't care about line return / empty line */
xmlKeepBlanksDefault(0);
/* check if the XML file has been encoded with utf8 (unicode) or not */
- if (stricmp("utf-8", encoding))
+ if (os_stricmp("utf-8", encoding))
{
free(encoding);
return NULL;
}
/*--------------------------------------------------------------------------*/
-JavaVM *FindCreatedJavaVM(char *SCILAB_PATH)
+JavaVM *FindCreatedJavaVM(const char *SCILAB_PATH)
{
JavaVM *jvm = NULL;
#include "os_string.h"
#include "strsubst.h"
#include "getos.h"
+#include "os_string.h"
#include "getshortpathname.h"
#include "BOOL.h"
#include "getScilabPreference.h"
/* Don't care about line return / empty line */
xmlKeepBlanksDefault(0);
/* check if the XML file has been encoded with utf8 (unicode) or not */
- if (stricmp("utf-8", encoding) == 0)
+ if (os_stricmp("utf-8", encoding) == 0)
{
xmlDocPtr doc = NULL;
xmlXPathContextPtr xpathCtxt = NULL;
/* Don't care about line return / empty line */
xmlKeepBlanksDefault(0);
/* check if the XML file has been encoded with utf8 (unicode) or not */
- if ( stricmp("utf-8", encoding) == 0 )
+ if ( os_stricmp("utf-8", encoding) == 0 )
{
xmlXPathContextPtr xpathCtxt = NULL;
xmlXPathObjectPtr xpathObj = NULL;
load = (char*)attrib->children->content;
/* By default, it is startup */
- if (stricmp(load, "background") == 0)
+ if (os_stricmp(load, "background") == 0)
{
eLoad = BACKGROUND;
}
else
{
- if (stricmp(load, "onuse") == 0)
+ if (os_stricmp(load, "onuse") == 0)
{
eLoad = ONUSE;
}
/* Don't care about line return / empty line */
xmlKeepBlanksDefault(0);
/* check if the XML file has been encoded with utf8 (unicode) or not */
- if ( stricmp("utf-8", encoding) == 0 )
+ if ( os_stricmp("utf-8", encoding) == 0 )
{
xmlDocPtr doc = NULL;
xmlXPathContextPtr xpathCtxt = NULL;
endif
LOCALIZATION_CPP_SOURCES = \
- src/cpp/localization.cpp \
src/cpp/UTF8.cpp
GATEWAY_C_SOURCES = \
src/c/getLcidString.c src/c/charEncoding.c \
src/c/setdefaultlanguage.c src/jni/Messages_wrap.c \
src/jni/LocaleToLCID_wrap.c src/jni/setdefaultlanguage_wrap.c \
- src/c/getLocaleInfo_Apple.c src/cpp/localization.cpp \
- src/cpp/UTF8.cpp
+ src/c/getLocaleInfo_Apple.c src/cpp/UTF8.cpp
am__dirstamp = $(am__leading_dot)dirstamp
@NEED_JAVA_TRUE@am__objects_1 = src/jni/libscilocalization_algo_la-Messages_wrap.lo \
@NEED_JAVA_TRUE@ src/jni/libscilocalization_algo_la-LocaleToLCID_wrap.lo \
src/c/libscilocalization_algo_la-charEncoding.lo \
src/c/libscilocalization_algo_la-setdefaultlanguage.lo \
$(am__objects_1) $(am__objects_2)
-am__objects_4 = src/cpp/libscilocalization_algo_la-localization.lo \
- src/cpp/libscilocalization_algo_la-UTF8.lo
+am__objects_4 = src/cpp/libscilocalization_algo_la-UTF8.lo
am_libscilocalization_algo_la_OBJECTS = $(am__objects_3) \
$(am__objects_4)
libscilocalization_algo_la_OBJECTS = \
src/c/charEncoding.c src/c/setdefaultlanguage.c \
$(am__append_1) $(am__append_2)
LOCALIZATION_CPP_SOURCES = \
- src/cpp/localization.cpp \
src/cpp/UTF8.cpp
GATEWAY_C_SOURCES = \
####localization : include files ####
libscilocalization_la_includedir = $(pkgincludedir)
libscilocalization_la_include_HEADERS = includes/localization.h \
-includes/localization.hxx \
includes/dynlib_localization.h \
includes/setgetlanguage.h \
includes/charEncoding.h
src/cpp/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) src/cpp/$(DEPDIR)
@: > src/cpp/$(DEPDIR)/$(am__dirstamp)
-src/cpp/libscilocalization_algo_la-localization.lo: \
- src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
src/cpp/libscilocalization_algo_la-UTF8.lo: src/cpp/$(am__dirstamp) \
src/cpp/$(DEPDIR)/$(am__dirstamp)
@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscilocalization_algo_la-setdefaultlanguage.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscilocalization_algo_la-setgetlanguage.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscilocalization_algo_la-UTF8.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscilocalization_algo_la-localization.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscilocalization_algo_la-LocaleToLCID_wrap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscilocalization_algo_la-Messages_wrap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscilocalization_algo_la-setdefaultlanguage_wrap.Plo@am__quote@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-src/cpp/libscilocalization_algo_la-localization.lo: src/cpp/localization.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilocalization_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscilocalization_algo_la-localization.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscilocalization_algo_la-localization.Tpo -c -o src/cpp/libscilocalization_algo_la-localization.lo `test -f 'src/cpp/localization.cpp' || echo '$(srcdir)/'`src/cpp/localization.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscilocalization_algo_la-localization.Tpo src/cpp/$(DEPDIR)/libscilocalization_algo_la-localization.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/cpp/localization.cpp' object='src/cpp/libscilocalization_algo_la-localization.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilocalization_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscilocalization_algo_la-localization.lo `test -f 'src/cpp/localization.cpp' || echo '$(srcdir)/'`src/cpp/localization.cpp
-
src/cpp/libscilocalization_algo_la-UTF8.lo: src/cpp/UTF8.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilocalization_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscilocalization_algo_la-UTF8.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscilocalization_algo_la-UTF8.Tpo -c -o src/cpp/libscilocalization_algo_la-UTF8.lo `test -f 'src/cpp/UTF8.cpp' || echo '$(srcdir)/'`src/cpp/UTF8.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscilocalization_algo_la-UTF8.Tpo src/cpp/$(DEPDIR)/libscilocalization_algo_la-UTF8.Plo
if (Lhs == 2)
{
int nb_diary_filenames = 0;
- char **diary_filenames = getDiaryFilenames(&nb_diary_filenames);
+ const char** diary_filenames = getDiaryFilenames(&nb_diary_filenames);
if ((diary_filenames) && (nb_diary_filenames > 0))
{
LhsVar(2) = Rhs + 2;
- freeArrayOfString(diary_filenames, nb_diary_filenames);
+ FREE(diary_filenames);
nb_diary_filenames = 0;
}
else
LhsVar(2) = Rhs + 2;
if (diary_filenames)
{
- freeArrayOfString(diary_filenames, nb_diary_filenames);
+ FREE(diary_filenames);
nb_diary_filenames = 0;
}
}
if (Lhs == 2)
{
- char* filenameUsed = getDiaryFilename((int)dID);
+ const char* filenameUsed = getDiaryFilename((int)dID);
sciErr = createMatrixOfString(pvApiCtx, Rhs + 2, 1, 1, &filenameUsed);
if (sciErr.iErr)
{
}
LhsVar(2) = Rhs + 2;
- FREE(filenameUsed);
}
}
else // diary(filename) exists (close diary)
if (Lhs == 2)
{
- char* filenameUsed = getDiaryFilename((int)dID);
+ const char* filenameUsed = getDiaryFilename((int)dID);
sciErr = createMatrixOfString(pvApiCtx, Rhs + 2, 1, 1, &filenameUsed);
if (sciErr.iErr)
{
}
LhsVar(2) = Rhs + 2;
- freeArrayOfString(&filenameUsed, 1);
}
PutLhsVar();
}
if (Lhs == 2)
{
- char* filenameUsed = getDiaryFilename((int)dID);
+ const char* filenameUsed = getDiaryFilename((int)dID);
sciErr = createMatrixOfString(pvApiCtx, Rhs + 2, 1, 1, &filenameUsed);
if (sciErr.iErr)
{
}
LhsVar(2) = Rhs + 2;
- FREE(filenameUsed);
}
PutLhsVar();
}
#include "DiaryList.hxx"
#include "diary.h"
#include "sci_malloc.h"
+#include "os_string.h"
/*--------------------------------------------------------------------------*/
static DiaryList *SCIDIARY = NULL;
/*--------------------------------------------------------------------------*/
return 1;
}
/*--------------------------------------------------------------------------*/
-char* getDiaryFilename(int _Id)
+const char* getDiaryFilename(int _Id)
{
- char* filename = NULL;
if (SCIDIARY)
{
if (SCIDIARY->getFilename(_Id).compare(""))
{
- filename = (char*)MALLOC(sizeof(char) * (SCIDIARY->getFilename(_Id).length() + 1));
- if (filename)
- {
- strcpy(filename, SCIDIARY->getFilename(_Id).c_str());
- }
+ return SCIDIARY->getFilename(_Id).c_str();
}
}
- return filename;
+ return nullptr;
}
/*--------------------------------------------------------------------------*/
-char **getDiaryFilenames(int *array_size)
+const char** getDiaryFilenames(int *array_size)
{
*array_size = 0;
if (SCIDIARY)
*array_size = (int)stringFilenames.size();
if (array_size > 0)
{
- char **filenames = (char **) MALLOC (sizeof(char*) * (*array_size));
+ const char **filenames = (const char **) MALLOC (sizeof(char*) * (*array_size));
int i = 0;
- for (const auto& filename : stringFilenames)
+ for (const auto & filename : stringFilenames)
{
- filenames[i] = (char*)MALLOC(sizeof(char) * (filename.length() + 1));
- strcpy(filenames[i], filename.data());
+ filenames[i] = filename.data();
++i;
}
return filenames;
}
}
- return NULL;
+ return nullptr;
}
/*--------------------------------------------------------------------------*/
int *getDiaryIDs(int *array_size)
* @param[in] _Id
* @return filename
*/
-OUTPUT_STREAM_IMPEXP char* getDiaryFilename(int _Id);
+OUTPUT_STREAM_IMPEXP const char* getDiaryFilename(int _Id);
/**
* get all filenames in manager
* @param[out] size of returned array
* @return filenames
*/
-OUTPUT_STREAM_IMPEXP char** getDiaryFilenames(int *array_size);
+OUTPUT_STREAM_IMPEXP const char** getDiaryFilenames(int *array_size);
/**
* get all IDs in manager
return;
}
- if (stricmp((*doc)->encoding, "utf-8"))
+ if (os_stricmp((*doc)->encoding, "utf-8"))
{
xmlFreeDoc(*doc);
*doc = NULL;
#include <sstream>
#include <string>
+#include <string.h>
#include "scilabWrite.hxx"
#include "LoggerView.hxx"
extern "C"
{
+#include "os_string.h"
#include "sci_malloc.h"
#include "charEncoding.h"
}
LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
libscistring_algo_la_LIBADD =
am__dirstamp = $(am__leading_dot)dirstamp
-am__objects_1 = src/c/libscistring_algo_la-convstr.lo \
- src/c/libscistring_algo_la-men_Sutils.lo \
+am__objects_1 = src/c/libscistring_algo_la-men_Sutils.lo \
src/c/libscistring_algo_la-tokens.lo \
src/c/libscistring_algo_la-strsplit.lo \
src/c/libscistring_algo_la-partfunction.lo \
src/cpp/os_wtoi.cpp
STRING_C_SOURCES = \
- src/c/convstr.c \
src/c/men_Sutils.c \
src/c/tokens.c \
src/c/strsplit.c \
libscistring_la_includedir = $(pkgincludedir)
libscistring_la_include_HEADERS = \
includes/complex_array.h \
-includes/convstr.h \
includes/cvstr.h \
includes/dynlib_string_gw.h \
includes/dynlib_string.h \
src/c/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) src/c/$(DEPDIR)
@: > src/c/$(DEPDIR)/$(am__dirstamp)
-src/c/libscistring_algo_la-convstr.lo: src/c/$(am__dirstamp) \
- src/c/$(DEPDIR)/$(am__dirstamp)
src/c/libscistring_algo_la-men_Sutils.lo: src/c/$(am__dirstamp) \
src/c/$(DEPDIR)/$(am__dirstamp)
src/c/libscistring_algo_la-tokens.lo: src/c/$(am__dirstamp) \
@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscistring_la-string_gw.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscistring_algo_la-StringConvert.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscistring_algo_la-complex_array.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscistring_algo_la-convstr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscistring_algo_la-cvstr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscistring_algo_la-getfastcode.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscistring_algo_la-isalphanum.Plo@am__quote@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-src/c/libscistring_algo_la-convstr.lo: src/c/convstr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_algo_la_CFLAGS) $(CFLAGS) -MT src/c/libscistring_algo_la-convstr.lo -MD -MP -MF src/c/$(DEPDIR)/libscistring_algo_la-convstr.Tpo -c -o src/c/libscistring_algo_la-convstr.lo `test -f 'src/c/convstr.c' || echo '$(srcdir)/'`src/c/convstr.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscistring_algo_la-convstr.Tpo src/c/$(DEPDIR)/libscistring_algo_la-convstr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/convstr.c' object='src/c/libscistring_algo_la-convstr.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_algo_la_CFLAGS) $(CFLAGS) -c -o src/c/libscistring_algo_la-convstr.lo `test -f 'src/c/convstr.c' || echo '$(srcdir)/'`src/c/convstr.c
-
src/c/libscistring_algo_la-men_Sutils.lo: src/c/men_Sutils.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_algo_la_CFLAGS) $(CFLAGS) -MT src/c/libscistring_algo_la-men_Sutils.lo -MD -MP -MF src/c/$(DEPDIR)/libscistring_algo_la-men_Sutils.Tpo -c -o src/c/libscistring_algo_la-men_Sutils.lo `test -f 'src/c/men_Sutils.c' || echo '$(srcdir)/'`src/c/men_Sutils.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscistring_algo_la-men_Sutils.Tpo src/c/$(DEPDIR)/libscistring_algo_la-men_Sutils.Plo
#define os_swprintf swprintf_s
#define os_sprintf sprintf_s
#define os_wcsicmp _wcsicmp
-#define stricmp _stricmp
-#define strnicmp _strnicmp
-#define wcsicmp _wcsicmp
-#define wcsnicmp _wcsnicmp
+#define os_stricmp _stricmp
+#define os_strnicmp _strnicmp
+#define os_wcsicmp _wcsicmp
+#define os_wcsnicmp _wcsnicmp
#define os_strcpy strcpy_s
#define os_splitpath _splitpath_s
#define os_wsplitpath _wsplitpath_s
#define os_strdup strdup
#define os_swprintf swprintf
-#define os_sprintf sprintf
+#define os_sprintf snprintf
+#define os_wcsicmp wcscasecmp
+#define os_stricmp strcasecmp
+#define os_strnicmp strncasecmp
#define os_wcsicmp wcscasecmp
-#define stricmp strcasecmp
-#define strnicmp strncasecmp
-#define wcsicmp wcscasecmp
-#define wcsnicmp wcsncasecmp
+#define os_wcsnicmp wcsncasecmp
#define os_strcpy strcpy
#define os_splitpath _splitpath
#define os_wsplitpath _wsplitpath
#define os_wcsdup _sciwcsdup
#define os_strdup strdup
#define os_swprintf swprintf
-#define os_sprintf sprintf
+#define os_sprintf snprintf
#include <stdlib.h>
#include <wchar.h>
}
#define os_wcsicmp macOSwcscasecmp
-#define stricmp strcasecmp
-#define strnicmp strncasecmp
-#define wcsicmp wcscasecmp
-#define wcsnicmp wcsncasecmp
+#define os_stricmp strcasecmp
+#define os_strnicmp strncasecmp
+#define os_wcsicmp wcscasecmp
+#define os_wcsnicmp wcsncasecmp
#define os_strcpy strcpy
#define os_splitpath _splitpath
#define os_wsplitpath _wsplitpath
#include "localization.h"
#include "Scierror.h"
#include "os_string.h"
+#include "os_wcstok.h"
#include <stdio.h>
}
}
else
{
-#ifndef _MSC_VER
- pstToken = strtok(pstString, pstSeps, &pstState);
-#else
- pstToken = strtok_s(pstString, pstSeps, &pstState);
-#endif
+ pstToken = os_strtok(pstString, pstSeps, &pstState);
}
pOutString = new types::String(dims, dimsArray);
char* os_strtok(char *_pstData, const char* _pstDelim, char** _pstState)
{
-#ifndef _MSC_VER
- return strtok(_pstData, _pstDelim, _pstState);
-#else
return strtok(_pstData, _pstDelim);
-#endif
}
wchar_t *os_wcstok(wchar_t *_pwstData, const wchar_t *_pwstDelim, wchar_t** _pswtState)
#define ComplexScilab "%i"
#define ComplexI "i"
/* ========================================================================== */
-#ifndef _MSC_VER
-#ifndef strnicmp
-#define strnicmp strncasecmp
-#endif
-#else
-#define stricmp _stricmp
-#endif
-#ifdef _MSC_VER
-#undef strnicmp
-#define strnicmp _strnicmp
-#endif
-/* ========================================================================== */
static int ParseNumber(const char* tx);
static stringToComplexError ParseComplexValue(const char *tx, BOOL bConvertByNAN, double *real, double *imag);
static char* midstring(const char *tx, size_t pos, int nb);
if (lnum <= 1)
{
/* manages special cases nan + nani, ... */
- if (strnicmp(modifiedTxt, NanString, strlen(NanString)) == 0)
+ if (os_strnicmp(modifiedTxt, NanString, strlen(NanString)) == 0)
{
lnum = strlen(NanString);
}
- else if (strnicmp(modifiedTxt, InfString, strlen(InfString)) == 0)
+ else if (os_strnicmp(modifiedTxt, InfString, strlen(InfString)) == 0)
{
lnum = strlen(InfString);
}
- else if (strnicmp(modifiedTxt, NegInfString, strlen(NegInfString)) == 0)
+ else if (os_strnicmp(modifiedTxt, NegInfString, strlen(NegInfString)) == 0)
{
lnum = strlen(NegInfString);
}
- else if (strnicmp(modifiedTxt, PosInfString, strlen(PosInfString)) == 0)
+ else if (os_strnicmp(modifiedTxt, PosInfString, strlen(PosInfString)) == 0)
{
lnum = strlen(PosInfString);
}
- else if (strnicmp(modifiedTxt, NegNanString, strlen(NegNanString)) == 0)
+ else if (os_strnicmp(modifiedTxt, NegNanString, strlen(NegNanString)) == 0)
{
lnum = strlen(NegNanString);
}
- else if (strnicmp(modifiedTxt, PosNanString, strlen(PosNanString)) == 0)
+ else if (os_strnicmp(modifiedTxt, PosNanString, strlen(PosNanString)) == 0)
{
lnum = strlen(PosNanString);
}
#include "core_math.h"
#include "sci_malloc.h"
#include "os_string.h"
-#ifndef _MSC_VER
-#ifndef stricmp
-#define stricmp strcasecmp
-#endif
-#else
-#define stricmp _stricmp
-#endif
/* ========================================================================== */
#define DEFAULT_DOUBLE_MAX_DIGIT_FORMAT "%lg"
/* ========================================================================== */
*ierr = STRINGTODOUBLE_ERROR;
if (pSTR)
{
- if ((stricmp(pSTR, NanString) == 0) || (stricmp(pSTR, NegNanString) == 0) ||
- (stricmp(pSTR, PosNanString) == 0) || (stricmp(pSTR, ScilabPosNanString) == 0) ||
- (stricmp(pSTR, ScilabNanString) == 0) || (stricmp(pSTR, ScilabNegNanString) == 0))
+ if ((os_stricmp(pSTR, NanString) == 0) || (os_stricmp(pSTR, NegNanString) == 0) ||
+ (os_stricmp(pSTR, PosNanString) == 0) || (os_stricmp(pSTR, ScilabPosNanString) == 0) ||
+ (os_stricmp(pSTR, ScilabNanString) == 0) || (os_stricmp(pSTR, ScilabNegNanString) == 0))
{
dValue = returnNAN();
}
- else if ((stricmp(pSTR, InfString) == 0) || (stricmp(pSTR, PosInfString) == 0) ||
- (stricmp(pSTR, ScilabInfString) == 0) || (stricmp(pSTR, ScilabPosInfString) == 0))
+ else if ((os_stricmp(pSTR, InfString) == 0) || (os_stricmp(pSTR, PosInfString) == 0) ||
+ (os_stricmp(pSTR, ScilabInfString) == 0) || (os_stricmp(pSTR, ScilabPosInfString) == 0))
{
dValue = returnINF(TRUE);
}
- else if ((stricmp(pSTR, NegInfString) == 0) || (stricmp(pSTR, ScilabNegInfString) == 0))
+ else if ((os_stricmp(pSTR, NegInfString) == 0) || (os_stricmp(pSTR, ScilabNegInfString) == 0))
{
dValue = returnINF(FALSE);
}
- else if ((stricmp(pSTR, ScilabPiString) == 0) || (stricmp(pSTR, ScilabPosPiString) == 0))
+ else if ((os_stricmp(pSTR, ScilabPiString) == 0) || (os_stricmp(pSTR, ScilabPosPiString) == 0))
{
dValue = M_PI;
}
- else if (stricmp(pSTR, ScilabNegPiString) == 0)
+ else if (os_stricmp(pSTR, ScilabNegPiString) == 0)
{
dValue = -M_PI;
}
- else if ((stricmp(pSTR, ScilabEpsString) == 0) || (stricmp(pSTR, ScilabPosEpsString) == 0))
+ else if ((os_stricmp(pSTR, ScilabEpsString) == 0) || (os_stricmp(pSTR, ScilabPosEpsString) == 0))
{
dValue = EPSILON;
}
- else if (stricmp(pSTR, ScilabNegEpsString) == 0)
+ else if (os_stricmp(pSTR, ScilabNegEpsString) == 0)
{
dValue = -EPSILON;
}
- else if ((stricmp(pSTR, ScilabEString) == 0) || (stricmp(pSTR, ScilabPosEString) == 0))
+ else if ((os_stricmp(pSTR, ScilabEString) == 0) || (os_stricmp(pSTR, ScilabPosEString) == 0))
{
dValue = exp(1);
}
- else if (stricmp(pSTR, ScilabNegEString) == 0)
+ else if (os_stricmp(pSTR, ScilabNegEString) == 0)
{
dValue = -exp(1);
}
if (dostricmp)
{
- returnedValues[i] = sign(stricmp(Input_String_One[i], Input_String_Two[j]));
+ returnedValues[i] = sign(os_stricmp(Input_String_One[i], Input_String_Two[j]));
}
else
{
ptr = ptr2;
}
- if (!strnicmp(ptr, tofind, strlen(tofind)))
+ if (!os_strnicmp(ptr, tofind, strlen(tofind)))
{
return (char *) ptr;
}
char** strsplit(const char* stringToSplit, double *indices, int sizeIndices, strsplit_error *ierr)
{
+ int i = 0;
wchar_t* w = to_wide_string(stringToSplit);
wchar_t** o = wide_strsplit(w, indices, sizeIndices, ierr);
if (*ierr == STRSPLIT_NO_ERROR)
{
char** output = (char**)MALLOC(sizeof(char*) * (sizeIndices + 1));
- for (int i = 0; i < sizeIndices + 1; ++i)
+ for (i = 0; i < sizeIndices + 1; ++i)
{
output[i] = wide_string_to_UTF8(o[i]);
}
if (mciGetErrorStringA(err, errtxt, 128) == FALSE)
{
- os_sprintf(errtxt, "%s", "Unknown MCI error");
+ os_sprintf(errtxt, 128, "%s", "Unknown MCI error");
}
out3 = errtxt;
printf(line);
strcpy(line, " Scilab Enterprises\n");
printf(line);
- strcpy(line, " Copyright (c) 2011-2015 (Scilab Enterprises)\n");
+ strcpy(line, " Copyright (c) 2011-2016 (Scilab Enterprises)\n");
printf(line);
strcpy(line, " Copyright (c) 1989-2012 (INRIA)\n");
printf(line);
#include "expandPathVariable.h"
#include "sci_malloc.h"
#include "localization.h"
-#ifdef _MSC_VER
#include "os_string.h"
-#endif
}
using namespace org_modules_xml;