diff options
author | Siddhesh Wani | 2015-05-25 14:46:31 +0530 |
---|---|---|
committer | Siddhesh Wani | 2015-05-25 14:46:31 +0530 |
commit | 6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26 (patch) | |
tree | 1b7bd89fdcfd01715713d8a15db471dc75a96bbf /2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci | |
download | Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.tar.gz Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.tar.bz2 Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.zip |
Original Version
Diffstat (limited to '2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci')
-rw-r--r-- | 2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci new file mode 100644 index 00000000..5c26dd85 --- /dev/null +++ b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci @@ -0,0 +1,87 @@ +function C_FinalizeCode(FileInfo,SharedInfo) +// function C_FinalizeCode(FileInfo,SharedInfo) +// ----------------------------------------------------------------- +// //NUT: add description here +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 27-Oct-2007 -- Raffaele Nutricato: Author. +// +// Copyright 2007 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),2,2); + +// ----------------------- +// --- Initialization. --- +// ----------------------- +// --- Load File Info Structure. --- +load(FileInfoDatFile,'FileInfo'); + +// --- Load Shared Info Structure. --- +load(FileInfo.SharedInfoDatFile,'SharedInfo'); + +CPass2FileName = FileInfo.Funct(SharedInfo.NextSCIFunNumber).CPass2FileName; +FinalCFileName = FileInfo.Funct(SharedInfo.NextSCIFunNumber).FinalCFileName; +Pass1HeaderFileName = FileInfo.Funct(SharedInfo.NextSCIFunNumber).Pass1HeaderFileName; +FinalHeaderFileName = FileInfo.Funct(SharedInfo.NextSCIFunNumber).FinalHeaderFileName; +// #RNU_RES_B +PrintStringInfo('Generating the final C code in:'+FinalCFileName,... + FileInfo.Funct(SharedInfo.NextSCIFunNumber).ReportFileName,'file','y'); +// #RNU_RES_E +// --------------------------- +// --- End Initialization. --- +// --------------------------- + +// --------------------------------- +// --- Finalize the header file. --- +// --------------------------------- +PrintStringInfo('/*',Pass1HeaderFileName,'file','y'); +PrintStringInfo('** ---------------------------- ',Pass1HeaderFileName,'file','y'); +PrintStringInfo('** --- End USER2C Includes. --- ',Pass1HeaderFileName,'file','y'); +PrintStringInfo('** ---------------------------- ',Pass1HeaderFileName,'file','y'); +PrintStringInfo('*/',Pass1HeaderFileName,'file','y'); +PrintStringInfo('#endif',Pass1HeaderFileName,'file','y'); +// ------------------------------------- +// --- End Finalize the header file. --- +// ------------------------------------- + +[tmphdrpath,tmphdrname,tmphdrext] = fileparts(Pass1HeaderFileName); + +// #RNU_RES_B +// -------------------------------------------------- +// --- Copy the C code into the C code directory. --- +// -------------------------------------------------- +// #RNU_RES_E +C_SCI2CHeader(FinalCFileName); +PrintStringInfo('/*',FinalCFileName,'file','y'); +PrintStringInfo('** ----------------- ',FinalCFileName,'file','y'); +PrintStringInfo('** --- Includes. --- ',FinalCFileName,'file','y'); +PrintStringInfo('** ----------------- ',FinalCFileName,'file','y'); +PrintStringInfo('*/',FinalCFileName,'file','y'); +PrintStringInfo('#include ""'+tmphdrname+tmphdrext+'""',... + FinalCFileName,'file','y'); +PrintStringInfo('/*',FinalCFileName,'file','y'); +PrintStringInfo('** --------------------- ',FinalCFileName,'file','y'); +PrintStringInfo('** --- End Includes. --- ',FinalCFileName,'file','y'); +PrintStringInfo('** --------------------- ',FinalCFileName,'file','y'); +PrintStringInfo('*/',FinalCFileName,'file','y'); +PrintStringInfo(' ',FinalCFileName,'file','y'); +PrintStringInfo(' ',FinalCFileName,'file','y'); +PrintStringInfo(' ',FinalCFileName,'file','y'); +SCI2Ccopyfile(CPass2FileName,... + FinalCFileName,'append'); +SCI2Ccopyfile(Pass1HeaderFileName,... + FinalHeaderFileName,'append'); + + +endfunction |