diff options
Diffstat (limited to 'macros/FunctionList')
-rw-r--r-- | macros/FunctionList/FL_ExistCFunction.sci | 234 | ||||
-rw-r--r-- | macros/FunctionList/FL_ExtractFuncList.sci | 124 | ||||
-rw-r--r-- | macros/FunctionList/FL_GetFunctionClass.sci | 108 | ||||
-rw-r--r-- | macros/FunctionList/FL_InOutArgs2CFunNames.sci | 102 | ||||
-rw-r--r-- | macros/FunctionList/FL_UpdateConverted.sci | 92 | ||||
-rw-r--r-- | macros/FunctionList/FL_UpdateToBeConv.sci | 228 |
6 files changed, 444 insertions, 444 deletions
diff --git a/macros/FunctionList/FL_ExistCFunction.sci b/macros/FunctionList/FL_ExistCFunction.sci index dbb9121f..7c3d24c5 100644 --- a/macros/FunctionList/FL_ExistCFunction.sci +++ b/macros/FunctionList/FL_ExistCFunction.sci @@ -1,117 +1,117 @@ -function flagexist = FL_ExistCFunction(CFunName,USER2CAvailableCDat,SCI2CAvailableCDat,ConvertedDat,ToBeConvertedDat,ReportFileName)
-// function flagexist = FL_ExistCFunction(CFunName,USER2CAvailableCDat,SCI2CAvailableCDat,ConvertedDat,ToBeConvertedDat,ReportFileName)
-// -----------------------------------------------------------------
-// //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 & Alberto Morea.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),6,6);
-
-// -----------------------
-// --- Initialization. ---
-// -----------------------
-flagexist = %F;
-// ---------------------------
-// --- End Initialization. ---
-// ---------------------------
-
-
-AvailableDat = USER2CAvailableCDat;
-load(AvailableDat,'Available');
-NAvail = size(Available,1);
-
-tmpcnt = 1;
-while ((tmpcnt <=NAvail) & (flagexist == %F))
- if mtlb_strcmp(Available(tmpcnt),CFunName)
- flagexist = %T;
- // #RNU_RES_B
- PrintStringInfo(' Found C Function Name in : '+AvailableDat,ReportFileName,'file','y');
- // #RNU_RES_E
- end
- tmpcnt = tmpcnt + 1;
-end
-clear Available
-
-if (flagexist == %F)
- AvailableDat = SCI2CAvailableCDat;
- load(AvailableDat,'Available');
- NAvail = size(Available,1);
-
- tmpcnt = 1;
- while ((tmpcnt <=NAvail) & (flagexist == %F))
- if mtlb_strcmp(Available(tmpcnt),CFunName)
- flagexist = %T;
- // #RNU_RES_B
- PrintStringInfo(' Found C Function Name in : '+AvailableDat,ReportFileName,'file','y');
- // #RNU_RES_E
- end
- tmpcnt = tmpcnt + 1;
- end
- clear Available
-end
-
-if (flagexist == %F)
- load(ConvertedDat,'Converted');
- NConv = size(Converted,1);
- tmpcnt = 1;
- while ((tmpcnt <=NConv) & (flagexist == %F))
- if mtlb_strcmp(Converted(tmpcnt),CFunName)
- flagexist = %T;
- // #RNU_RES_B
- PrintStringInfo(' Found C Function Name in : '+ConvertedDat,ReportFileName,'file','y');
- // #RNU_RES_E
- end
- tmpcnt = tmpcnt + 1;
- end
- clear Converted
-end
-
-if (flagexist == %F)
- load(ToBeConvertedDat,'ToBeConverted');
- NToBeConv = size(ToBeConverted,1);
- tmpcnt = 1;
- while ((tmpcnt <=NToBeConv) & (flagexist == %F))
- if mtlb_strcmp(ToBeConverted(tmpcnt).CFunctionName,CFunName)
- flagexist = %T;
- // #RNU_RES_B
- PrintStringInfo(' Found C Function Name in : '+ToBeConvertedDat,ReportFileName,'file','y');
- // #RNU_RES_E
- end
- tmpcnt = tmpcnt + 1;
- end
- clear ToBeConverted
-end
-
-if (flagexist == %F)
- // #RNU_RES_B
- AvailableDat = SCI2CAvailableCDat;
-
- PrintStringInfo(' C Function Name not found in the ""Available"" , ""Converted"" and ""ToBeConverted"" function lists.',ReportFileName,'file','y');
- load(AvailableDat,'Available');
- PrintStringInfo('Available: ' + strcat(Available(grep(Available, ASTFunName)), ' '),ReportFileName,'file','y');
- clear Available
- load(ConvertedDat,'Converted');
- PrintStringInfo('Converted: ' + strcat(Converted(grep(Converted, ASTFunName)), ' '),ReportFileName,'file','y');
- clear Converted
- load(ToBeConvertedDat,'ToBeConverted');
- PrintStringInfo('ToBeConverted: ' + ToBeConverted.SCIFunctionName + ' ' + ToBeConverted.CFunctionName,ReportFileName,'file','y');
- clear ToBeConverted
- // #RNU_RES_E
-end
-
-endfunction
+function flagexist = FL_ExistCFunction(CFunName,USER2CAvailableCDat,SCI2CAvailableCDat,ConvertedDat,ToBeConvertedDat,ReportFileName) +// function flagexist = FL_ExistCFunction(CFunName,USER2CAvailableCDat,SCI2CAvailableCDat,ConvertedDat,ToBeConvertedDat,ReportFileName) +// ----------------------------------------------------------------- +// //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 & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),6,6); + +// ----------------------- +// --- Initialization. --- +// ----------------------- +flagexist = %F; +// --------------------------- +// --- End Initialization. --- +// --------------------------- + + +AvailableDat = USER2CAvailableCDat; +load(AvailableDat,'Available'); +NAvail = size(Available,1); + +tmpcnt = 1; +while ((tmpcnt <=NAvail) & (flagexist == %F)) + if mtlb_strcmp(Available(tmpcnt),CFunName) + flagexist = %T; + // #RNU_RES_B + PrintStringInfo(' Found C Function Name in : '+AvailableDat,ReportFileName,'file','y'); + // #RNU_RES_E + end + tmpcnt = tmpcnt + 1; +end +clear Available + +if (flagexist == %F) + AvailableDat = SCI2CAvailableCDat; + load(AvailableDat,'Available'); + NAvail = size(Available,1); + + tmpcnt = 1; + while ((tmpcnt <=NAvail) & (flagexist == %F)) + if mtlb_strcmp(Available(tmpcnt),CFunName) + flagexist = %T; + // #RNU_RES_B + PrintStringInfo(' Found C Function Name in : '+AvailableDat,ReportFileName,'file','y'); + // #RNU_RES_E + end + tmpcnt = tmpcnt + 1; + end + clear Available +end + +if (flagexist == %F) + load(ConvertedDat,'Converted'); + NConv = size(Converted,1); + tmpcnt = 1; + while ((tmpcnt <=NConv) & (flagexist == %F)) + if mtlb_strcmp(Converted(tmpcnt),CFunName) + flagexist = %T; + // #RNU_RES_B + PrintStringInfo(' Found C Function Name in : '+ConvertedDat,ReportFileName,'file','y'); + // #RNU_RES_E + end + tmpcnt = tmpcnt + 1; + end + clear Converted +end + +if (flagexist == %F) + load(ToBeConvertedDat,'ToBeConverted'); + NToBeConv = size(ToBeConverted,1); + tmpcnt = 1; + while ((tmpcnt <=NToBeConv) & (flagexist == %F)) + if mtlb_strcmp(ToBeConverted(tmpcnt).CFunctionName,CFunName) + flagexist = %T; + // #RNU_RES_B + PrintStringInfo(' Found C Function Name in : '+ToBeConvertedDat,ReportFileName,'file','y'); + // #RNU_RES_E + end + tmpcnt = tmpcnt + 1; + end + clear ToBeConverted +end + +if (flagexist == %F) + // #RNU_RES_B + AvailableDat = SCI2CAvailableCDat; + + PrintStringInfo(' C Function Name not found in the ""Available"" , ""Converted"" and ""ToBeConverted"" function lists.',ReportFileName,'file','y'); + load(AvailableDat,'Available'); + PrintStringInfo('Available: ' + strcat(Available(grep(Available, ASTFunName)), ' '),ReportFileName,'file','y'); + clear Available + load(ConvertedDat,'Converted'); + PrintStringInfo('Converted: ' + strcat(Converted(grep(Converted, ASTFunName)), ' '),ReportFileName,'file','y'); + clear Converted + load(ToBeConvertedDat,'ToBeConverted'); + PrintStringInfo('ToBeConverted: ' + ToBeConverted.SCIFunctionName + ' ' + ToBeConverted.CFunctionName,ReportFileName,'file','y'); + clear ToBeConverted + // #RNU_RES_E +end + +endfunction diff --git a/macros/FunctionList/FL_ExtractFuncList.sci b/macros/FunctionList/FL_ExtractFuncList.sci index cbc14655..a5a0182f 100644 --- a/macros/FunctionList/FL_ExtractFuncList.sci +++ b/macros/FunctionList/FL_ExtractFuncList.sci @@ -1,62 +1,62 @@ -function [CFuncList,NElements] = FL_ExtractFuncList(FunctionDir,ClassDir,SCI2CClassSpecifier,ExtFLCls,ReportFileName)
-// function [CFuncList,NElements] = FL_ExtractFuncList(FunctionDir,ClassDir,SCI2CClassSpecifier,ExtFLCls,ReportFileName)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// Extracts the list of the C functions available. To do that
-// this function enters in the directories where the .clst and
-// .lst files are stored.
-// #RNU_RES_E
-//
-// Input data:
-// //NUT: add description here
-//
-// Output data:
-// //NUT: add description here
-//
-// Status:
-// 05-Jan-2008 -- Nutricato Raffaele: Author.
-//
-// Copyright 2008 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),5,5);
-
-// #RNU_RES_B
-// ---------------------------------------------------------
-// --- Extract the list of files in Functions directory. ---
-// ---------------------------------------------------------
-// #RNU_RES_E
-tmppwd = pwd();
-cd(FunctionDir);
-// funfiles = ls();
-funfiles = listfiles();
-cd(tmppwd);
-NFunFiles = size(funfiles,1);
-
-// #RNU_RES_B
-// -----------------------------------------------------------
-// --- Extract the C function list from Classes directory. ---
-// -----------------------------------------------------------
-// #RNU_RES_E
-CFuncList = '';
-NElements = 0;
-
-for cntfun = 1:NFunFiles
- FunFileName = fullfile(FunctionDir,funfiles(cntfun));
- ClassName = FL_GetFunctionClass(FunFileName,SCI2CClassSpecifier,ReportFileName);
- ClassFileName = fullfile(ClassDir,ClassName);
- [tmpfunlist,tmpnelem] = File2StringArray(ClassFileName+ExtFLCls);
- [tmppath,tmpfunname,tmpext] = fileparts(FunFileName);
- tmpfunlist = FL_InOutArgs2CFunNames(tmpfunname,tmpfunlist,tmpnelem);
- for cnttmpfun = 1:tmpnelem
- NElements = NElements + 1;
- CFuncList(NElements) = tmpfunlist(cnttmpfun);
- end
-end
-
-endfunction
+function [CFuncList,NElements] = FL_ExtractFuncList(FunctionDir,ClassDir,SCI2CClassSpecifier,ExtFLCls,ReportFileName) +// function [CFuncList,NElements] = FL_ExtractFuncList(FunctionDir,ClassDir,SCI2CClassSpecifier,ExtFLCls,ReportFileName) +// ----------------------------------------------------------------- +// #RNU_RES_B +// Extracts the list of the C functions available. To do that +// this function enters in the directories where the .clst and +// .lst files are stored. +// #RNU_RES_E +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 05-Jan-2008 -- Nutricato Raffaele: Author. +// +// Copyright 2008 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),5,5); + +// #RNU_RES_B +// --------------------------------------------------------- +// --- Extract the list of files in Functions directory. --- +// --------------------------------------------------------- +// #RNU_RES_E +tmppwd = pwd(); +cd(FunctionDir); +// funfiles = ls(); +funfiles = listfiles(); +cd(tmppwd); +NFunFiles = size(funfiles,1); + +// #RNU_RES_B +// ----------------------------------------------------------- +// --- Extract the C function list from Classes directory. --- +// ----------------------------------------------------------- +// #RNU_RES_E +CFuncList = ''; +NElements = 0; + +for cntfun = 1:NFunFiles + FunFileName = fullfile(FunctionDir,funfiles(cntfun)); + ClassName = FL_GetFunctionClass(FunFileName,SCI2CClassSpecifier,ReportFileName); + ClassFileName = fullfile(ClassDir,ClassName); + [tmpfunlist,tmpnelem] = File2StringArray(ClassFileName+ExtFLCls); + [tmppath,tmpfunname,tmpext] = fileparts(FunFileName); + tmpfunlist = FL_InOutArgs2CFunNames(tmpfunname,tmpfunlist,tmpnelem); + for cnttmpfun = 1:tmpnelem + NElements = NElements + 1; + CFuncList(NElements) = tmpfunlist(cnttmpfun); + end +end + +endfunction diff --git a/macros/FunctionList/FL_GetFunctionClass.sci b/macros/FunctionList/FL_GetFunctionClass.sci index 09fad929..a872e423 100644 --- a/macros/FunctionList/FL_GetFunctionClass.sci +++ b/macros/FunctionList/FL_GetFunctionClass.sci @@ -1,54 +1,54 @@ -function SCI2CClassName = FL_GetFunctionClass(FunFileName,SCI2CClassSpecifier,ReportFileName)
-// function SCI2CClassName = FL_GetFunctionClass(FunFileName,SCI2CClassSpecifier,ReportFileName)
-// -----------------------------------------------------------------
-// //NUT: add description here
-//
-// Input data:
-// //NUT: add description here
-//
-// Output data:
-// //NUT: add description here
-//
-// Status:
-// 11-Jul-2007 -- Nutricato Raffaele: Author.
-//
-// Copyright 2007 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),3,3);
-
-// ---------------------------------------
-// --- Read the class of the function. ---
-// ---------------------------------------
-// --- Open the .sci file (read only). ---
-inannfid = SCI2COpenFileRead(FunFileName);
-
-FoundClass = 0;
-if (meof(inannfid) == 0)
- check_string = stripblanks(mgetl(inannfid,1));
- if (~isempty(check_string))
- if (SCI2Cstrncmps1size(SCI2CClassSpecifier,check_string))
- SCI2CClassName = part(check_string,length(SCI2CClassSpecifier)+1:length(check_string));
- // #RNU_RES_B
- PrintStringInfo(' Function belongs to class: '+SCI2CClassName+'.',ReportFileName,'file','y');
- // #RNU_RES_E
- FoundClass = 1;
- else
- error(9999, 'Could not find ""'+SCI2CClassSpecifier+'"" in '+FunFileName+'.');
- end
- end
-end
-mclose(inannfid);
-if (FoundClass == 0)
- error(9999, 'Could not find ""'+SCI2CClassSpecifier+'"" specifier.');
-end
-
-// -------------------------------------------
-// --- End read the class of the function. ---
-// -------------------------------------------
-endfunction
-
\ No newline at end of file +function SCI2CClassName = FL_GetFunctionClass(FunFileName,SCI2CClassSpecifier,ReportFileName) +// function SCI2CClassName = FL_GetFunctionClass(FunFileName,SCI2CClassSpecifier,ReportFileName) +// ----------------------------------------------------------------- +// //NUT: add description here +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 11-Jul-2007 -- Nutricato Raffaele: Author. +// +// Copyright 2007 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),3,3); + +// --------------------------------------- +// --- Read the class of the function. --- +// --------------------------------------- +// --- Open the .sci file (read only). --- +inannfid = SCI2COpenFileRead(FunFileName); + +FoundClass = 0; +if (meof(inannfid) == 0) + check_string = stripblanks(mgetl(inannfid,1)); + if (~isempty(check_string)) + if (SCI2Cstrncmps1size(SCI2CClassSpecifier,check_string)) + SCI2CClassName = part(check_string,length(SCI2CClassSpecifier)+1:length(check_string)); + // #RNU_RES_B + PrintStringInfo(' Function belongs to class: '+SCI2CClassName+'.',ReportFileName,'file','y'); + // #RNU_RES_E + FoundClass = 1; + else + error(9999, 'Could not find ""'+SCI2CClassSpecifier+'"" in '+FunFileName+'.'); + end + end +end +mclose(inannfid); +if (FoundClass == 0) + error(9999, 'Could not find ""'+SCI2CClassSpecifier+'"" specifier.'); +end + +// ------------------------------------------- +// --- End read the class of the function. --- +// ------------------------------------------- +endfunction + diff --git a/macros/FunctionList/FL_InOutArgs2CFunNames.sci b/macros/FunctionList/FL_InOutArgs2CFunNames.sci index e559f385..0dfee1d3 100644 --- a/macros/FunctionList/FL_InOutArgs2CFunNames.sci +++ b/macros/FunctionList/FL_InOutArgs2CFunNames.sci @@ -1,51 +1,51 @@ -function FunNameCFuncList = FL_InOutArgs2CFunNames(FunctionName,CommaSepCFuncList,CFuncListNElem)
-// function FunNameCFuncList = FL_InOutArgs2CFunNames(FunctionName,CommaSepCFuncList,CFuncListNElem)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// Reads a Comma Separated Function List and converts it into the
-// corresponding list of C function. In the Comma Separated
-// Function List only input and output arguments are specified
-// and they are separated by a comma.
-// #RNU_RES_E
-//
-// Input data:
-// //NUT: add description here
-//
-// Output data:
-// //NUT: add description here
-//
-// Status:
-// 05-Jan-2008 -- Nutricato Raffaele: Author.
-//
-// Copyright 2008 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),3,3);
-
-
-FunNameCFuncList = '';
-SepChar = ',';
-for cntelem = 1:CFuncListNElem
- tmptokens = tokens(CommaSepCFuncList(cntelem),SepChar);
- if (size(tmptokens,1) == 0)
- FunNameCFuncList(cntelem) = FunctionName;
- elseif (size(tmptokens,1) == 1)
- if part(tmptokens,1:1) == ','
- FunNameCFuncList(cntelem) = FunctionName+tmptokens(2);
- else
- FunNameCFuncList(cntelem) = tmptokens(1)+FunctionName;
- end
- elseif (size(tmptokens,1) == 2)
- FunNameCFuncList(cntelem) = tmptokens(1)+FunctionName+tmptokens(2);
- else
- disp('Incorrect format for the function list class.');
- error(9999, 'Check the following function list class item: ""'+CommaSepCFuncList(cntelem)+'"".');
- end
-end
-
-endfunction
+function FunNameCFuncList = FL_InOutArgs2CFunNames(FunctionName,CommaSepCFuncList,CFuncListNElem) +// function FunNameCFuncList = FL_InOutArgs2CFunNames(FunctionName,CommaSepCFuncList,CFuncListNElem) +// ----------------------------------------------------------------- +// #RNU_RES_B +// Reads a Comma Separated Function List and converts it into the +// corresponding list of C function. In the Comma Separated +// Function List only input and output arguments are specified +// and they are separated by a comma. +// #RNU_RES_E +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 05-Jan-2008 -- Nutricato Raffaele: Author. +// +// Copyright 2008 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),3,3); + + +FunNameCFuncList = ''; +SepChar = ','; +for cntelem = 1:CFuncListNElem + tmptokens = tokens(CommaSepCFuncList(cntelem),SepChar); + if (size(tmptokens,1) == 0) + FunNameCFuncList(cntelem) = FunctionName; + elseif (size(tmptokens,1) == 1) + if part(tmptokens,1:1) == ',' + FunNameCFuncList(cntelem) = FunctionName+tmptokens(2); + else + FunNameCFuncList(cntelem) = tmptokens(1)+FunctionName; + end + elseif (size(tmptokens,1) == 2) + FunNameCFuncList(cntelem) = tmptokens(1)+FunctionName+tmptokens(2); + else + disp('Incorrect format for the function list class.'); + error(9999, 'Check the following function list class item: ""'+CommaSepCFuncList(cntelem)+'"".'); + end +end + +endfunction diff --git a/macros/FunctionList/FL_UpdateConverted.sci b/macros/FunctionList/FL_UpdateConverted.sci index 5f4637e8..e1403e80 100644 --- a/macros/FunctionList/FL_UpdateConverted.sci +++ b/macros/FunctionList/FL_UpdateConverted.sci @@ -1,46 +1,46 @@ -function Converted = FL_UpdateConverted(NFilesToTranslate,ConvertedDatFile)
-// function Converted = FL_UpdateConverted(NFilesToTranslate,ConvertedDatFile)
-// -----------------------------------------------------------------
-// //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 Converted .dat file. ---
-load(ConvertedDatFile,'Converted');
-// ---------------------------
-// --- End Initialization. ---
-// ---------------------------
-
-
-if (NFilesToTranslate >= 1)
- // ---------------------------------------
- // --- Update Converted Function List. ---
- // ---------------------------------------
- // --- Insert the current function into the converted function list. ---
- NConvP1 = size(Converted,1)+1;
- Converted(NConvP1) = SharedInfo.NextCFunName;
- // -------------------------------------------
- // --- End Update Converted Function List. ---
- // -------------------------------------------
-end
-
-endfunction
+function Converted = FL_UpdateConverted(NFilesToTranslate,ConvertedDatFile) +// function Converted = FL_UpdateConverted(NFilesToTranslate,ConvertedDatFile) +// ----------------------------------------------------------------- +// //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 Converted .dat file. --- +load(ConvertedDatFile,'Converted'); +// --------------------------- +// --- End Initialization. --- +// --------------------------- + + +if (NFilesToTranslate >= 1) + // --------------------------------------- + // --- Update Converted Function List. --- + // --------------------------------------- + // --- Insert the current function into the converted function list. --- + NConvP1 = size(Converted,1)+1; + Converted(NConvP1) = SharedInfo.NextCFunName; + // ------------------------------------------- + // --- End Update Converted Function List. --- + // ------------------------------------------- +end + +endfunction diff --git a/macros/FunctionList/FL_UpdateToBeConv.sci b/macros/FunctionList/FL_UpdateToBeConv.sci index 1ee2e15d..169f1a36 100644 --- a/macros/FunctionList/FL_UpdateToBeConv.sci +++ b/macros/FunctionList/FL_UpdateToBeConv.sci @@ -1,114 +1,114 @@ -function SharedInfo = FL_UpdateToBeConv(ASTFunName,CFunName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg,FileInfo,SharedInfo)
-// function SharedInfo = FL_UpdateToBeConv(ASTFunName,CFunName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg,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),11,11);
-
-// -----------------------
-// --- Initialization. ---
-// -----------------------
-nxtscifunname = SharedInfo.NextSCIFunName;
-nxtscifunnumber = SharedInfo.NextSCIFunNumber;
-
-ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName;
-SCI2CAvailableCDat = FileInfo.FunctionList.SCI2CAvailableCDat;
-USER2CAvailableCDat = FileInfo.FunctionList.USER2CAvailableCDat;
-ConvertedDat = FileInfo.FunctionList.ConvertedDat;
-ToBeConvertedDat = FileInfo.FunctionList.ToBeConvertedDat;
-FunInfoDatDir = FileInfo.FunctionList.FunInfoDatDir;
-
-// #RNU_RES_B
-PrintStringInfo(' ',ReportFileName,'file','y');
-PrintStringInfo('***Updating C Function List***',ReportFileName,'file','y');
-PrintStringInfo(' C Function Name: '+CFunName,ReportFileName,'file','y');
-// #RNU_RES_E
-// ---------------------------
-// --- End Initialization. ---
-// ---------------------------
-
-// #RNU_RES_B
-// --------------------------------------------------
-// --- Manage anticipated exit from the function. ---
-// --------------------------------------------------
-//NUT: questo codice e' identico quasi a quello della CFunCall, si pu0 pensare di
-//NUT: di fare un'unica funzione.
-// #RNU_RES_E
-
-if (SharedInfo.SkipNextFun > 0)
- // #RNU_RES_B
- PrintStringInfo(' Current function will not be inserted in the Function List.',ReportFileName,'file','y');
- // #RNU_RES_E
- return;
-end
-
-// #RNU_RES_B
-// Exit if the function is a precision specifier and the corresponding flag is 1.
-// #RNU_RES_E
-if ((sum(mtlb_strcmp(ASTFunName,SharedInfo.Annotations.DataPrec)) > 0) & ...
- (SharedInfo.SkipNextPrec == 1))
- // #RNU_RES_B
- PrintStringInfo(' Current function will not be inserted in the Function List.',ReportFileName,'file','y');
- // #RNU_RES_E
- return;
-end
-
-// #RNU_RES_B
-// Exit if the function is OpEqual and the corresponding skip flag is enabled.
-// #RNU_RES_E
-if ((mtlb_strcmp(ASTFunName,'OpEqual')) & ...
- (SharedInfo.SkipNextEqual == 1))
- // #RNU_RES_B
- PrintStringInfo(' Current function will not be inserted in the Function List.',ReportFileName,'file','y');
- // #RNU_RES_E
- return;
-end
-
-// #RNU_RES_B
-// ---------------------------------------
-// --- If the function is not skipped. ---
-// ---------------------------------------
-// --- Check existence of the C function. ---
-// #RNU_RES_E
-flagexist = FL_ExistCFunction(CFunName,USER2CAvailableCDat,SCI2CAvailableCDat,ConvertedDat,ToBeConvertedDat,ReportFileName);
-
-// #RNU_RES_B
-// --- Update C function list and dat files. ---
-// #RNU_RES_E
-if (flagexist == %F)
-
- // #RNU_RES_B
- // --- Add C function to the "ToBeConverted" function list. ---
- // #RNU_RES_E
- load(ToBeConvertedDat,'ToBeConverted');
-
- NToConvP1 = size(ToBeConverted,1)+1;
- ToBeConverted(NToConvP1).SCIFunctionName = ASTFunName;
- ToBeConverted(NToConvP1).CFunctionName = CFunName;
-
- save(ToBeConvertedDat, "ToBeConverted");
- SharedInfo.NFilesToTranslate = SharedInfo.NFilesToTranslate + 1;
-
- // #RNU_RES_B
- // --- Generate C Function dat file. ---
- PrintStringInfo(' Add C Function ""'+CFunName+'"" to: '+ToBeConvertedDat,ReportFileName,'file','y');
- // #RNU_RES_E
-end
-
-endfunction
+function SharedInfo = FL_UpdateToBeConv(ASTFunName,CFunName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg,FileInfo,SharedInfo) +// function SharedInfo = FL_UpdateToBeConv(ASTFunName,CFunName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg,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),11,11); + +// ----------------------- +// --- Initialization. --- +// ----------------------- +nxtscifunname = SharedInfo.NextSCIFunName; +nxtscifunnumber = SharedInfo.NextSCIFunNumber; + +ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; +SCI2CAvailableCDat = FileInfo.FunctionList.SCI2CAvailableCDat; +USER2CAvailableCDat = FileInfo.FunctionList.USER2CAvailableCDat; +ConvertedDat = FileInfo.FunctionList.ConvertedDat; +ToBeConvertedDat = FileInfo.FunctionList.ToBeConvertedDat; +FunInfoDatDir = FileInfo.FunctionList.FunInfoDatDir; + +// #RNU_RES_B +PrintStringInfo(' ',ReportFileName,'file','y'); +PrintStringInfo('***Updating C Function List***',ReportFileName,'file','y'); +PrintStringInfo(' C Function Name: '+CFunName,ReportFileName,'file','y'); +// #RNU_RES_E +// --------------------------- +// --- End Initialization. --- +// --------------------------- + +// #RNU_RES_B +// -------------------------------------------------- +// --- Manage anticipated exit from the function. --- +// -------------------------------------------------- +//NUT: questo codice e' identico quasi a quello della CFunCall, si pu0 pensare di +//NUT: di fare un'unica funzione. +// #RNU_RES_E + +if (SharedInfo.SkipNextFun > 0) + // #RNU_RES_B + PrintStringInfo(' Current function will not be inserted in the Function List.',ReportFileName,'file','y'); + // #RNU_RES_E + return; +end + +// #RNU_RES_B +// Exit if the function is a precision specifier and the corresponding flag is 1. +// #RNU_RES_E +if ((sum(mtlb_strcmp(ASTFunName,SharedInfo.Annotations.DataPrec)) > 0) & ... + (SharedInfo.SkipNextPrec == 1)) + // #RNU_RES_B + PrintStringInfo(' Current function will not be inserted in the Function List.',ReportFileName,'file','y'); + // #RNU_RES_E + return; +end + +// #RNU_RES_B +// Exit if the function is OpEqual and the corresponding skip flag is enabled. +// #RNU_RES_E +if ((mtlb_strcmp(ASTFunName,'OpEqual')) & ... + (SharedInfo.SkipNextEqual == 1)) + // #RNU_RES_B + PrintStringInfo(' Current function will not be inserted in the Function List.',ReportFileName,'file','y'); + // #RNU_RES_E + return; +end + +// #RNU_RES_B +// --------------------------------------- +// --- If the function is not skipped. --- +// --------------------------------------- +// --- Check existence of the C function. --- +// #RNU_RES_E +flagexist = FL_ExistCFunction(CFunName,USER2CAvailableCDat,SCI2CAvailableCDat,ConvertedDat,ToBeConvertedDat,ReportFileName); + +// #RNU_RES_B +// --- Update C function list and dat files. --- +// #RNU_RES_E +if (flagexist == %F) + + // #RNU_RES_B + // --- Add C function to the "ToBeConverted" function list. --- + // #RNU_RES_E + load(ToBeConvertedDat,'ToBeConverted'); + + NToConvP1 = size(ToBeConverted,1)+1; + ToBeConverted(NToConvP1).SCIFunctionName = ASTFunName; + ToBeConverted(NToConvP1).CFunctionName = CFunName; + + save(ToBeConvertedDat, "ToBeConverted"); + SharedInfo.NFilesToTranslate = SharedInfo.NFilesToTranslate + 1; + + // #RNU_RES_B + // --- Generate C Function dat file. --- + PrintStringInfo(' Add C Function ""'+CFunName+'"" to: '+ToBeConvertedDat,ReportFileName,'file','y'); + // #RNU_RES_E +end + +endfunction |