summaryrefslogtreecommitdiff
path: root/2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.sci
diff options
context:
space:
mode:
authorAnkit Raj2017-06-21 10:26:59 +0530
committerAnkit Raj2017-06-21 10:26:59 +0530
commita555820564d9f2e95ca8c97871339d3a5a2081c3 (patch)
treeadb074b66a8e6750209880e6932305ce0a94c8bf /2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.sci
downloadScilab2C-a555820564d9f2e95ca8c97871339d3a5a2081c3.tar.gz
Scilab2C-a555820564d9f2e95ca8c97871339d3a5a2081c3.tar.bz2
Scilab2C-a555820564d9f2e95ca8c97871339d3a5a2081c3.zip
Updated Scilab2C
Diffstat (limited to '2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.sci')
-rw-r--r--2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.sci55
1 files changed, 55 insertions, 0 deletions
diff --git a/2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.sci b/2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.sci
new file mode 100644
index 00000000..001ed250
--- /dev/null
+++ b/2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.sci
@@ -0,0 +1,55 @@
+function Sci2AnnotationFile(SciFileName,ClsFileName,AnnFileName,AnnSpecifier,ReportFileName)
+// function Sci2AnnotationFile(SciFileName,ClsFileName,AnnFileName,AnnSpecifier,ReportFileName)
+// --------------------------------------------------------------------------------
+// #RNU_RES_B
+// This function reads the .sci input file and generates the correspondig .ann
+// and .acls files.
+// #RNU_RES_E
+//
+// Input data:
+// //NUT: add description here
+//
+// Output data:
+// //NUT: add description here
+//
+// Status:
+// 25-Jun-2007 -- Nutricato Raffaele: Author.
+//
+// Copyright 2007 Raffaele Nutricato.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),5,5);
+
+[tmppath,tmpfunname,tmpext] = fileparts(SciFileName);
+
+// ---------------------------------------
+// --- Open the .sci file (read only). ---
+// ---------------------------------------
+inscifid = SCI2COpenFileRead(SciFileName);
+
+// ----------------------------------------------
+// --- Loop over the lines of the input file. ---
+// ----------------------------------------------
+line_position = 0;
+L_AnnSpecifierP1 = length(AnnSpecifier)+1;
+while (meof(inscifid) == 0)
+ check_string = stripblanks(mgetl(inscifid,1));
+ line_position = line_position + 1;
+ L_string = length(check_string);
+ if (L_string >= 1)
+ if (SCI2Cstrncmps1size(AnnSpecifier,check_string))
+ tmpannotation = stripblanks(part(check_string,L_AnnSpecifierP1:L_string));
+ PrintStringInfo(tmpannotation,ClsFileName,'file','y');
+ end
+ end
+end
+mclose(inscifid);
+// --------------------------------------------------
+// --- End loop over the lines of the input file. ---
+// --------------------------------------------------
+PrintStringInfo('CLASS: '+tmpfunname,AnnFileName,'file','y');
+endfunction