diff options
author | Ankit Raj | 2017-06-21 10:26:59 +0530 |
---|---|---|
committer | Ankit Raj | 2017-06-21 10:26:59 +0530 |
commit | 958577cac90a99124cd673fde1926781d966d91f (patch) | |
tree | 134d9fe7f5b97a647cb055bb7b4c21820a749f49 /macros/CCodeGeneration/GenCFunDatFiles.sci | |
download | Scilab2C_fossee_old-958577cac90a99124cd673fde1926781d966d91f.tar.gz Scilab2C_fossee_old-958577cac90a99124cd673fde1926781d966d91f.tar.bz2 Scilab2C_fossee_old-958577cac90a99124cd673fde1926781d966d91f.zip |
Updated Scilab2C
Diffstat (limited to 'macros/CCodeGeneration/GenCFunDatFiles.sci')
-rw-r--r-- | macros/CCodeGeneration/GenCFunDatFiles.sci | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/macros/CCodeGeneration/GenCFunDatFiles.sci b/macros/CCodeGeneration/GenCFunDatFiles.sci new file mode 100644 index 0000000..9af858c --- /dev/null +++ b/macros/CCodeGeneration/GenCFunDatFiles.sci @@ -0,0 +1,73 @@ +function GenCFunDatFiles(FunctionName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg,CFunName,LibTypeInfo,FunInfoDatDir) +// function GenCFunDatFiles(FunctionName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg,CFunName,LibTypeInfo,FunInfoDatDir) +// ----------------------------------------------------------------- +// //NUT: add description here +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 30-Oct-2007 -- Raffaele Nutricato: Author. +// 30-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// #RNU_RES_B +//NUT Nella fun info posso mettere le size simboliche per out arg e non quelle numeriche +//NUT che non usero' mai, anche perche' se un giorno decidero' di cambiare approccio e usero' funzioni +//NUT differenti per size differenti allora dovro' cambiare anche il loro nome per distinguerle +//NUT e di conseguenza avro' funinfo differenti. +// #RNU_RES_E +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),11,11); + + +// ----------------------- +// --- Initialization. --- +// ----------------------- +// --------------------------- +// --- End Initialization. --- +// --------------------------- + +// #RNU_RES_B +// ---------------------------------------------------------- +// --- Find Position of the first output scalar argument. --- +// ---------------------------------------------------------- +// #RNU_RES_E +PosFirstOutScalar = 0; +FoundOutScalar = 0; +for counterout = 1:NOutArg + if (OutArg(counterout).Dimension == 0) + if (FoundOutScalar==0) + PosFirstOutScalar = counterout; + FoundOutScalar = 1; + end + end +end + +// ------------------------------------ +// --- Update C function dat files. --- +// ------------------------------------ +clear FunInfo +FunInfo.SCIFunctionName = FunctionName; +FunInfo.CFunctionName = CFunName; +FunInfo.FunPrecSpecifier = FunPrecSpecifier; +FunInfo.FunTypeAnnot = FunTypeAnnot; +FunInfo.FunSizeAnnot = FunSizeAnnot; +FunInfo.InArg = InArg; +FunInfo.NInArg = NInArg; +FunInfo.OutArg = OutArg; +FunInfo.NOutArg = NOutArg; +FunInfo.PosFirstOutScalar = PosFirstOutScalar; +FunInfo.LibTypeInfo = LibTypeInfo; +save(fullfile(FunInfoDatDir,CFunName+'.dat'), "FunInfo"); +clear FunInfo + +endfunction |