1 /*
2 *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 *  Copyright (C) 2011 - DIGITEO - Antoine ELIAS
4 *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13 *
14 */
15 
16 #ifndef __TYPES_TOOLS_HXX__
17 #define __TYPES_TOOLS_HXX__
18 
19 #include "types.hxx"
20 #include "function.hxx"
21 #include "double.hxx"
22 
23 namespace types
24 {
25 bool getScalarIndex(GenericType* _pRef, typed_list* _pArgsIn, int* index);
26 bool getArgsDims(typed_list* _pArgsIn, std::vector<int>& dims); //only for insertNew
27 bool getImplicitIndex(GenericType* _pRef, typed_list* _pArgsIn, std::vector<int>& index, std::vector<int>& dims);
28 bool getScalarImplicitIndex(GenericType* _pRef, typed_list* _pArgsIn, std::vector<double>& index);
29 
30 EXTERN_AST int checkIndexesArguments(InternalType* _pRef, typed_list* _pArgsIn, typed_list* _pArgsOut, int* _piMaxDim, int* _piCountDim);
31 EXTERN_AST void cleanIndexesArguments(typed_list* _pArgsOrig, typed_list* _pArgsNew);
32 EXTERN_AST void getIndexesWithDims(int _iIndex, int* _piIndexes, const int* _piDims, int _iDims);
33 EXTERN_AST int getIndexWithDims(int* _piIndexes, const int* _piDims, int _iDims);
34 EXTERN_AST types::Function::ReturnValue VariableToString(types::InternalType* pIT, const wchar_t* wcsVarName);
35 
36 //commom function
37 EXTERN_AST int computeTuples(int* _piCountDim, int _iDims, int _iCurrentDim, int* _piIndex);
38 EXTERN_AST Double* createEmptyDouble();
39 EXTERN_AST Double* createDoubleVector(int _iSize);
40 EXTERN_AST int getIntValueFromDouble(InternalType* _pIT, int _iPos);
41 EXTERN_AST double* getDoubleArrayFromDouble(InternalType* _pIT);
42 EXTERN_AST bool checkArgValidity(typed_list& _pArg);
43 }
44 
45 #endif /* !__TYPES_TOOLS_HXX__ */
46