diff options
author | yash1112 | 2017-07-07 21:20:49 +0530 |
---|---|---|
committer | yash1112 | 2017-07-07 21:20:49 +0530 |
commit | 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 (patch) | |
tree | f50d6e06d8fe6bc1a9053ef10d4b4d857800ab51 /2.3-1/macros/FunctionList/FL_ExtractFuncList.sci | |
download | Scilab2C-9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0.tar.gz Scilab2C-9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0.tar.bz2 Scilab2C-9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0.zip |
sci2c arduino updated
Diffstat (limited to '2.3-1/macros/FunctionList/FL_ExtractFuncList.sci')
-rw-r--r-- | 2.3-1/macros/FunctionList/FL_ExtractFuncList.sci | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/2.3-1/macros/FunctionList/FL_ExtractFuncList.sci b/2.3-1/macros/FunctionList/FL_ExtractFuncList.sci new file mode 100644 index 00000000..cbc14655 --- /dev/null +++ b/2.3-1/macros/FunctionList/FL_ExtractFuncList.sci @@ -0,0 +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
|