diff options
author | siddhu8990 | 2016-06-06 09:18:33 +0530 |
---|---|---|
committer | siddhu8990 | 2016-06-06 09:18:33 +0530 |
commit | c75fb67154fb5679d6ede9a52d5f5ae15600f9f9 (patch) | |
tree | c2c950617ab555a0fa74a4f7e0c592ec80bcf3bd /macros/CCodeGeneration | |
parent | 212c54043e454e41ca4b23a5b965d4dbd4b683fe (diff) | |
download | Scilab2C_fossee_old-c75fb67154fb5679d6ede9a52d5f5ae15600f9f9.tar.gz Scilab2C_fossee_old-c75fb67154fb5679d6ede9a52d5f5ae15600f9f9.tar.bz2 Scilab2C_fossee_old-c75fb67154fb5679d6ede9a52d5f5ae15600f9f9.zip |
File handling functions added
Diffstat (limited to 'macros/CCodeGeneration')
-rw-r--r-- | macros/CCodeGeneration/C_Funcall.bin | bin | 71780 -> 71972 bytes | |||
-rw-r--r-- | macros/CCodeGeneration/C_Funcall.sci | 10 | ||||
-rw-r--r-- | macros/CCodeGeneration/C_GenDeclarations.bin | bin | 22000 -> 22004 bytes | |||
-rw-r--r-- | macros/CCodeGeneration/C_GenDeclarations.sci | 2 | ||||
-rw-r--r-- | macros/CCodeGeneration/C_GenerateMakefile.bin | bin | 26832 -> 27820 bytes | |||
-rw-r--r-- | macros/CCodeGeneration/C_GenerateMakefile.sci | 11 | ||||
-rw-r--r-- | macros/CCodeGeneration/C_Type.bin | bin | 4680 -> 5232 bytes | |||
-rw-r--r-- | macros/CCodeGeneration/C_Type.sci | 5 |
8 files changed, 20 insertions, 8 deletions
diff --git a/macros/CCodeGeneration/C_Funcall.bin b/macros/CCodeGeneration/C_Funcall.bin Binary files differindex f54c0c3..23b9e6f 100644 --- a/macros/CCodeGeneration/C_Funcall.bin +++ b/macros/CCodeGeneration/C_Funcall.bin diff --git a/macros/CCodeGeneration/C_Funcall.sci b/macros/CCodeGeneration/C_Funcall.sci index eec20c7..22a2770 100644 --- a/macros/CCodeGeneration/C_Funcall.sci +++ b/macros/CCodeGeneration/C_Funcall.sci @@ -222,7 +222,7 @@ if(mtlb_strcmp(part(CFunName,1:5),'odefn') == %F) else TmpInArgName = InArg(counterin).Name; end - + TmpInArgType = C_Type(InArg(counterin).Type); //if (FunctionName == 'OpEqual') @@ -251,8 +251,8 @@ else //function containing odes in specific format which is differnt than generated //above. for counterin = 1:NInArg - - if(counterin <> 3) //Skip third argument + + //if((NInArg == 4 & counterin <> 3) | (NInArg == 5 & counterin <> 4)) //Skip third argument if (InArg(counterin).Type == 'g' & InArg(counterin).Scope == 'String') TmpInArgName = '""'+InArg(counterin).Name+'""'; elseif (InArg(counterin).Type == 'z' & (InArg(counterin).Scope == 'Number')) @@ -262,7 +262,7 @@ else else TmpInArgName = InArg(counterin).Name; end - + TmpInArgType = C_Type(InArg(counterin).Type); //if (FunctionName == 'OpEqual') @@ -283,7 +283,7 @@ else CCall = CCall+TmpInArgName+', ';//+TmpInArgSizeVar+','; end end - end + //end end end diff --git a/macros/CCodeGeneration/C_GenDeclarations.bin b/macros/CCodeGeneration/C_GenDeclarations.bin Binary files differindex 1e6c455..c3b3600 100644 --- a/macros/CCodeGeneration/C_GenDeclarations.bin +++ b/macros/CCodeGeneration/C_GenDeclarations.bin diff --git a/macros/CCodeGeneration/C_GenDeclarations.sci b/macros/CCodeGeneration/C_GenDeclarations.sci index eb61723..41ba3a9 100644 --- a/macros/CCodeGeneration/C_GenDeclarations.sci +++ b/macros/CCodeGeneration/C_GenDeclarations.sci @@ -92,7 +92,7 @@ if (ArgStruct.Dimension > 0) Cdeclaration(2) = Cdeclaration(2)+';'; end else - if (ArgStruct.Type == 'f') + if (ArgStruct.Type == 'fn') //do nothing. This is a function name. Will be declared in header file. else if (FlagExt == 1) diff --git a/macros/CCodeGeneration/C_GenerateMakefile.bin b/macros/CCodeGeneration/C_GenerateMakefile.bin Binary files differindex 76090ba..3ced74fb 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.bin +++ b/macros/CCodeGeneration/C_GenerateMakefile.bin diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci index fecbf91..94b3696 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/macros/CCodeGeneration/C_GenerateMakefile.sci @@ -90,10 +90,19 @@ target = SharedInfo.Target; PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y'); allSources = getAllSources(target); nbSources = size(allSources); + for i = 1:(nbSources(1) - 1) [tmppath,tmpfile,tmpext] = fileparts(allSources(i)); - PrintStringInfo(' $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y'); + + if(~isempty(strstr(allSources(i),'ode'))) + if(size(SharedInfo.ODElist) <> 0) + PrintStringInfo(' $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y'); + end + else + PrintStringInfo(' $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y'); + end end + [tmppath,tmpfile,tmpext] = fileparts(allSources(nbSources(1))); PrintStringInfo(' $(CSRCDIR)/'+tmpfile+tmpext, FileInfo.MakefileFilename,'file','y','y'); diff --git a/macros/CCodeGeneration/C_Type.bin b/macros/CCodeGeneration/C_Type.bin Binary files differindex 64037d4..18e0a1b 100644 --- a/macros/CCodeGeneration/C_Type.bin +++ b/macros/CCodeGeneration/C_Type.bin diff --git a/macros/CCodeGeneration/C_Type.sci b/macros/CCodeGeneration/C_Type.sci index 506c8fd..6e9a295 100644 --- a/macros/CCodeGeneration/C_Type.sci +++ b/macros/CCodeGeneration/C_Type.sci @@ -34,7 +34,7 @@ elseif (ArgType == 'i') elseif (ArgType == 'g') OutC_Type = 'char'; elseif (ArgType == 'f') - OutC_Type = 'SCI2CFILEID'; + OutC_Type = 'FILE *'; elseif (ArgType == 'u8') OutC_Type = 'uint8'; elseif (ArgType == 'i8') @@ -43,6 +43,9 @@ elseif (ArgType == 'u16') OutC_Type = 'uint16'; elseif (ArgType == 'i16') OutC_Type = 'int16'; +elseif (ArgType == 'fn') //This type introduced for ODE function, + // as it's one of the inout argument is name of the other function + OutC_Type = ''; else error(9999, 'Unknown Argument Type: ""'+ArgType+'"".'); end |